Skip to content

Commit

Permalink
cmd/go: add test case for cgo CC setting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rsc authored and rolandshoemaker committed Jan 21, 2021
1 parent 5a8a226 commit b186e4d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/cmd/go/testdata/script/cgo_path.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b186e4d

Please sign in to comment.