...

Source file src/internal/coverage/cfile/testdata/issue56006/repro.go

Documentation: internal/coverage/cfile/testdata/issue56006

     1  package main
     2  
     3  //go:noinline
     4  func blah(x int) int {
     5  	if x != 0 {
     6  		return x + 42
     7  	}
     8  	return x - 42
     9  }
    10  
    11  func main() {
    12  	go infloop()
    13  	println(blah(1) + blah(0))
    14  }
    15  
    16  var G int
    17  
    18  func infloop() {
    19  	for {
    20  		G += blah(1)
    21  		G += blah(0)
    22  		if G > 10000 {
    23  			G = 0
    24  		}
    25  	}
    26  }
    27  

View as plain text