| [!GOARCH:amd64] skip | |
| # Large static offsets are initialized dynamically. | |
| go tool compile -S -p=p -o ok.o ok.go | |
| stdout 'MOVB.*p\.\.stmp_0\+1073741824\(SB\)' | |
| ! stderr . | |
| # Multiword constants must not straddle the static offset limit. | |
| go tool compile -S -p=p -o straddle.o straddle.go | |
| stdout 'MOVQ.*p\.x\+1073741824\(SB\)' | |
| ! stderr . | |
| # Oversized symbols fail without leaking an internal error. | |
| ! go tool compile -p=p -o too_large.o too_large.go | |
| stdout 'symbol too large' | |
| ! stdout 'prepwrite' | |
| ! stderr . | |
| -- ok.go -- | |
| package p | |
| var x = []byte{1 << 30: 1} | |
| -- straddle.go -- | |
| package p | |
| type T struct { | |
| _ [1<<30 - 8]byte | |
| s string | |
| } | |
| var x = T{s: "x"} | |
| -- too_large.go -- | |
| package p | |
| var x = []string{100000000000000: "x"} |