github.com/go-asm/go@v1.21.1-0.20240213172139-40c5ead50c48/cmd/compile/ssa/testdata/i22600.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  )
     7  
     8  func test() {
     9  	pwd, err := os.Getwd()
    10  	if err != nil {
    11  		fmt.Println(err)
    12  		os.Exit(1)
    13  	}
    14  	fmt.Println(pwd)
    15  }
    16  
    17  func main() {
    18  	growstack() // Use stack early to prevent growth during test, which confuses gdb
    19  	test()
    20  }
    21  
    22  var snk string
    23  
    24  //go:noinline
    25  func growstack() {
    26  	snk = fmt.Sprintf("%#v,%#v,%#v", 1, true, "cat")
    27  }