Source file test/fixedbugs/issue80710.dir/x.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Test that a caller correctly restores its stack pointer even when
     6  // the ABI0 NOFRAME assembly function it calls clobbers BP.
     7  // See https://go.dev/issue/80710
     8  
     9  package main
    10  
    11  //go:noescape
    12  func noframe(*int)
    13  
    14  //go:noinline
    15  func caller(indir func(*int)) {
    16  	var useSomeStackSpace int
    17  	noframe(&useSomeStackSpace)
    18  	indir(nil)
    19  }
    20  
    21  func main() {
    22  	caller(noframe)
    23  }
    24  

View as plain text