Black Lives Matter. Support the Equal Justice Initiative.

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

Documentation: cmd/go/testdata/script

     1  # Issue #7573
     2  # cmd/cgo: undefined reference when linking a C-library using gccgo
     3  
     4  [!cgo] skip
     5  [!gccgo] skip
     6  
     7  go build -r -compiler gccgo cgoref
     8  stderr 'gccgo.*\-L [^ ]*alibpath \-lalib' # make sure that Go-inline "#cgo LDFLAGS:" ("-L alibpath -lalib") passed to gccgo linking stage
     9  
    10  -- cgoref/cgoref.go --
    11  package main
    12  // #cgo LDFLAGS: -L alibpath -lalib
    13  // void f(void) {}
    14  import "C"
    15  
    16  func main() { C.f() }

View as plain text