Text file src/cmd/compile/testdata/script/issue78974.txt

     1  [!GOARCH:amd64] skip
     2  
     3  # Large static offsets are initialized dynamically.
     4  go tool compile -S -p=p -o ok.o ok.go
     5  stdout 'MOVB.*p\.\.stmp_0\+1073741824\(SB\)'
     6  ! stderr .
     7  
     8  # Multiword constants must not straddle the static offset limit.
     9  go tool compile -S -p=p -o straddle.o straddle.go
    10  stdout 'MOVQ.*p\.x\+1073741824\(SB\)'
    11  ! stderr .
    12  
    13  # Oversized symbols fail without leaking an internal error.
    14  ! go tool compile -p=p -o too_large.o too_large.go
    15  stdout 'symbol too large'
    16  ! stdout 'prepwrite'
    17  ! stderr .
    18  
    19  -- ok.go --
    20  package p
    21  
    22  var x = []byte{1 << 30: 1}
    23  
    24  -- straddle.go --
    25  package p
    26  
    27  type T struct {
    28  	_ [1<<30 - 8]byte
    29  	s string
    30  }
    31  
    32  var x = T{s: "x"}
    33  
    34  -- too_large.go --
    35  package p
    36  
    37  var x = []string{100000000000000: "x"}
    38  

View as plain text