Text file src/cmd/go/testdata/script/build_pie_race.txt

     1  # go build -buildmode=pie -race main.go on Darwin should work without errors
     2  
     3  [!race] skip 'test requires race detector support'
     4  
     5  [!GOOS:darwin] ! go build -buildmode=pie -race
     6  [!GOOS:darwin] stderr '^-buildmode=pie not supported when -race is enabled on '$GOOS'/'$GOARCH'$'
     7  [!GOOS:darwin] stop 'not testing -buildmode=pie -race on platform that does not support it'
     8  
     9  go build -buildmode=pie -race bytes
    10  ! stderr .
    11  
    12  [short] stop 'not linking a binary in -short mode'
    13  
    14  go build -buildmode=pie -race main.go
    15  ! stderr .
    16  exec ./main
    17  stdout 'Hello, 世界'
    18  
    19  -- go.mod --
    20  module m
    21  
    22  go 1.21
    23  -- main.go --
    24  package main
    25  
    26  import "fmt"
    27  
    28  func main() {
    29  	fmt.Println("Hello, 世界")
    30  }
    31  

View as plain text