github.com/code-reading/golang@v0.0.0-20220303082512-ba5bc0e589a3/go/src/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 //go:build race 6 // +build race 7 8 package race 9 10 import ( 11 "bytes" 12 "os/exec" 13 "path/filepath" 14 "runtime" 15 "testing" 16 ) 17 18 func TestIssue37485(t *testing.T) { 19 files, err := filepath.Glob("./*.syso") 20 if err != nil { 21 t.Fatalf("can't find syso files: %s", err) 22 } 23 for _, f := range files { 24 cmd := exec.Command(filepath.Join(runtime.GOROOT(), "bin", "go"), "tool", "nm", f) 25 res, err := cmd.CombinedOutput() 26 if err != nil { 27 t.Errorf("nm of %s failed: %s", f, err) 28 continue 29 } 30 if bytes.Contains(res, []byte("getauxval")) { 31 t.Errorf("%s contains getauxval", f) 32 } 33 } 34 }