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.
9 // wasm is excluded because the compiler chatter about register abi pragma ends up
10 // on stdout, and causes the expected output to not match.
16 // This test is designed to provoke a stack growth
17 // in a way that very likely leaves junk in the
18 // parameter save area if they aren't saved or spilled
19 // there, as appropriate.
23 func f(x int, xm1, xm2, p *int) {
24 var y = [2]int{x - 4, 0}
30 g(*xm1, xm2, &x, p) // xm1 is no longer live.
31 h(*xm2, &x, &y[0], p) // xm2 is no longer live, but was spilled.
36 func g(x int, xm1, xm2, p *int) {
37 var y = [3]int{x - 4, 0, 0}
49 func h(x int, xm1, xm2, p *int) {
50 var y = [4]int{x - 4, 0, 0, 0}
62 func k(x int, xm1, xm2, p *int) {
63 var y = [5]int{x - 4, 0, 0, 0, 0}
80 fmt.Printf("Fib(%d)=%d\n", x, y)