
- updated go/packages to support new export format - rewrite testinline.go fixture because the compiler got too smart with constant folding - temporarily disable staticcheck on go1.20 because it doesn't support the new export format. - workaround for go.dev/cl/429601
27 lines
301 B
Go
27 lines
301 B
Go
package main
|
|
|
|
import "fmt"
|
|
|
|
func inlineThis(a int) int {
|
|
z := a * a
|
|
return f(z + a)
|
|
}
|
|
|
|
func initialize(a, b *int) {
|
|
*a = 3
|
|
*b = 4
|
|
}
|
|
|
|
func main() {
|
|
var a, b int
|
|
initialize(&a, &b)
|
|
a = inlineThis(a)
|
|
b = inlineThis(b)
|
|
fmt.Printf("%d %d\n", a, b)
|
|
}
|
|
|
|
//go:noinline
|
|
func f(x int) int {
|
|
return x
|
|
}
|