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// Test that we extend that limit to include large argument/return areas. 9// Argument/return areas are part of the parent frame, not the frame itself, 10// so they need to be handled separately. 11 12package main 13 14// >1GB to trigger failure, <2GB to work on 32-bit platforms. 15type large struct { 16 b [1500000000]byte 17} 18 19func (x large) f1() int { // GC_ERROR "stack frame too large" 20 return 5 21} 22 23func f2(x large) int { // GC_ERROR "stack frame too large" 24 return 5 25} 26 27func f3() (x large, i int) { // GC_ERROR "stack frame too large" 28 return 29} 30