Text file src/cmd/go/testdata/script/build_gcflags.txt

     1  env 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  
    10  env GOCACHE=$WORK/gocache  # Looking for compile commands, so need a clean cache.
    11  go build -x -n -buildmode=c-archive -gcflags=all=-shared=false ./override.go
    12  stderr '^.*/compile (.* )?-shared (.* )?-shared=false'
    13  
    14  -- override.go --
    15  package main
    16  
    17  import "C"
    18  
    19  //export GoFunc
    20  func GoFunc() {}
    21  
    22  func main() {}
    23  

View as plain text