github.com/geraldss/go/src@v0.0.0-20210511222824-ac7d0ebfc235/runtime/race/syso_test.go (about) 1 // Copyright 2020 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build !android,!js,!ppc64le 6 7 // Note: we don't run on Android or ppc64 because if there is any non-race test 8 // file in this package, the OS tries to link the .syso file into the 9 // test (even when we're not in race mode), which fails. I'm not sure 10 // why, but easiest to just punt - as long as a single builder runs 11 // this test, we're good. 12 13 package race 14 15 import ( 16 "bytes" 17 "os/exec" 18 "path/filepath" 19 "runtime" 20 "testing" 21 ) 22 23 func TestIssue37485(t *testing.T) { 24 files, err := filepath.Glob("./*.syso") 25 if err != nil { 26 t.Fatalf("can't find syso files: %s", err) 27 } 28 for _, f := range files { 29 cmd := exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), "tool", "nm", f) 30 res, err := cmd.CombinedOutput() 31 if err != nil { 32 t.Errorf("nm of %s failed: %s", f, err) 33 continue 34 } 35 if bytes.Contains(res, []byte("getauxval")) { 36 t.Errorf("%s contains getauxval", f) 37 } 38 } 39 }