aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/cgo_path.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/testdata/script/cgo_path.txt')
-rw-r--r--src/cmd/go/testdata/script/cgo_path.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/cmd/go/testdata/script/cgo_path.txt b/src/cmd/go/testdata/script/cgo_path.txt
index e4d07dea2c..548a65ffa8 100644
--- a/src/cmd/go/testdata/script/cgo_path.txt
+++ b/src/cmd/go/testdata/script/cgo_path.txt
@@ -1,12 +1,20 @@
[!cgo] skip
+# Set CC explicitly to something that requires a PATH lookup.
+# Normally, the default is gcc or clang, but if CC was set during make.bash,
+# that becomes the default.
+[exec:clang] env CC=clang
+[exec:gcc] env CC=gcc
+[!exec:clang] [!exec:gcc] skip 'Unknown C compiler'
+
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] chmod 0755 p/gcc p/clang
[!windows] exists p/gcc p/clang
[windows] exists p/gcc.bat p/clang.bat
! exists p/bug.txt
-go build -x
+! go build -x
+stderr '^cgo: exec (clang|gcc): (clang|gcc) resolves to executable in current directory \(.[/\\](clang|gcc)(.bat)?\)$'
! exists p/bug.txt
-- go.mod --