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

     1  # Tests golang.org/issue/47682
     2  # Flags specified with -gcflags should appear after other flags generated by cmd/go.
     3  
     4  cd m
     5  go build -n -gcflags=-lang=go1.17
     6  stderr ' -lang=go1.16.* -lang=go1.17'
     7  ! go build -gcflags='-c 0'
     8  stderr 'compile: -c must be at least 1, got 0'
     9  
    10  -- m/go.mod --
    11  module example.com
    12  
    13  go 1.16
    14  
    15  -- m/main.go --
    16  package main
    17  
    18  func main() {
    19      var s = []int{1, 2, 3}
    20      var pa = (*[2]int)(s[1:])
    21      println(pa[1])
    22  }
    23  

View as plain text