Source file test/abi/wrapdefer_largetmp.go

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

View as plain text