Source file test/fixedbugs/issue25507.go

     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  
    12  package main
    13  
    14  // >1GB to trigger failure, <2GB to work on 32-bit platforms.
    15  type large struct {
    16  	b [1500000000]byte
    17  }
    18  
    19  func (x large) f1() int { // GC_ERROR "stack frame too large"
    20  	return 5
    21  }
    22  
    23  func f2(x large) int { // GC_ERROR "stack frame too large"
    24  	return 5
    25  }
    26  
    27  func f3() (x large, i int) { // GC_ERROR "stack frame too large"
    28  	return
    29  }
    30  

View as plain text