Source file test/fixedbugs/issue20780.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  // Make sure we include the callee args section.
     9  
    10  package main
    11  
    12  type Big = [400e6]byte
    13  
    14  func 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  
    24  func g(Big, Big)
    25  func h() Big
    26  

View as plain text