Source file src/runtime/race/syso_test.go

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

View as plain text