Source file test/abi/wrapdefer_largetmp.go
1 // run 2 3 //go:build !wasm 4 5 // Copyright 2021 The Go Authors. All rights reserved. 6 // Use of this source code is governed by a BSD-style 7 // license that can be found in the LICENSE file. 8 9 package main 10 11 //go:noinline 12 func F() { 13 b := g() 14 defer g2(b) 15 n := g()[20] 16 println(n) 17 } 18 19 type T [45]int 20 21 var x = 0 22 23 //go:noinline 24 func g() T { 25 x++ 26 return T{20: x} 27 } 28 29 //go:noinline 30 func g2(t T) { 31 if t[20] != 1 { 32 println("FAIL", t[20]) 33 } 34 } 35 36 func main() { F() } 37