1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:51:37 -07:00

cmd/go: add test case for cgo CC setting

Change-Id: Ied986053a64447c5eac6369f6c9b69ed3d3f94d9
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/949415
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/284782
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Roland Shoemaker <roland@golang.org>
This commit is contained in:
Russ Cox 2021-01-11 09:43:08 -05:00 committed by Roland Shoemaker
parent 5a8a2265fb
commit b186e4d70d

35
src/cmd/go/testdata/script/cgo_path.txt vendored Normal file
View File

@ -0,0 +1,35 @@
[!cgo] skip
env GOCACHE=$WORK/gocache # Looking for compile flags, so need a clean cache.
[!windows] env PATH=.:$PATH
[!windows] chmod 0777 p/gcc p/clang
[!windows] exists -exec p/gcc p/clang
[windows] exists -exec p/gcc.bat p/clang.bat
! exists p/bug.txt
go build -x
! exists p/bug.txt
-- go.mod --
module m
-- m.go --
package m
import _ "m/p"
-- p/p.go --
package p
// #define X 1
import "C"
-- p/gcc --
#!/bin/sh
echo ran gcc >bug.txt
-- p/clang --
#!/bin/sh
echo ran clang >bug.txt
-- p/gcc.bat --
echo ran gcc >bug.txt
-- p/clang.bat --
echo ran clang >bug.txt