1// errorcheck
2
3// Copyright 2018 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// We have a limit of 1GB for stack frames.
8// Make sure we include the callee args section.
9
10package main
11
12type Big = [400e6]byte
13
14func f() { // GC_ERROR "stack frame too large"
15	// Note: This test relies on the fact that we currently always
16	// spill function-results to the stack, even if they're so
17	// large that we would normally heap allocate them. If we ever
18	// improve the backend to spill temporaries to the heap, this
19	// test will probably need updating to find some new way to
20	// construct an overly large stack frame.
21	g(h(), h())
22}
23
24func g(Big, Big)
25func h() Big
26