...
1# Test that syso in deps is available to cgo.
2
3[!compiler:gc] skip 'requires syso support'
4[!cgo] skip
5[short] skip 'invokes system C compiler'
6
7# External linking is not supported on linux/ppc64.
8# See: https://github.com/golang/go/issues/8912
9[GOOS:linux] [GOARCH:ppc64] skip
10
11cc -c -o syso/x.syso syso/x.c
12cc -c -o syso2/x.syso syso2/x.c
13go build m/cgo
14
15-- go.mod --
16module m
17
18go 1.18
19-- cgo/x.go --
20package cgo
21
22// extern void f(void);
23// extern void g(void);
24import "C"
25
26func F() {
27 C.f()
28}
29
30func G() {
31 C.g()
32}
33
34-- cgo/x2.go --
35package cgo
36
37import _ "m/syso"
38
39-- syso/x.c --
40//go:build ignore
41
42void f() {}
43
44-- syso/x.go --
45package syso
46
47import _ "m/syso2"
48
49-- syso2/x.c --
50//go:build ignore
51
52void g() {}
53
54-- syso2/x.go --
55package syso2
View as plain text