misc/cgo/testcshared: don't overwrite cc in parallel runs

Fixes #22176

Change-Id: If47ec9a25da6b480868d8eeccc518dc97d48bda7
Reviewed-on: https://go-review.googlesource.com/69230
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
This commit is contained in:
Ian Lance Taylor 2017-10-08 22:00:34 -07:00
parent e8a27daaef
commit 24f9db7c20
1 changed files with 3 additions and 1 deletions

View File

@ -210,7 +210,9 @@ func runExe(t *testing.T, env []string, args ...string) string {
func runCC(t *testing.T, args ...string) string {
t.Helper()
return run(t, nil, append(cc, args...)...)
// This function is run in parallel, so append to a copy of cc
// rather than cc itself.
return run(t, nil, append(append([]string(nil), cc...), args...)...)
}
func createHeaders() error {