...
1env GO111MODULE=off
2
3# Test that the user can override default code generation flags.
4
5[compiler:gccgo] skip # gccgo does not use -gcflags
6[!cgo] skip
7[!GOOS:linux] skip # test only works if c-archive implies -shared
8[short] skip
9
10env GOCACHE=$WORK/gocache # Looking for compile commands, so need a clean cache.
11go build -x -n -buildmode=c-archive -gcflags=all=-shared=false ./override.go
12stderr '^.*/compile (.* )?-shared (.* )?-shared=false'
13
14-- override.go --
15package main
16
17import "C"
18
19//export GoFunc
20func GoFunc() {}
21
22func main() {}
View as plain text