test/fixedbugs/issue59404part2.go
raw| 1 | // run |
| 2 | |
| 3 | // Copyright 2023 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 | package main |
| 8 | |
| 9 | var G func(int) int |
| 10 | |
| 11 | //go:noinline |
| 12 | func callclo(q, r int) int { |
| 13 | p := func(z int) int { |
| 14 | G = func(int) int { return 1 } |
| 15 | return z + 1 |
| 16 | } |
| 17 | res := p(q) ^ p(r) // These calls to "p" will be inlined |
| 18 | G = p |
| 19 | return res |
| 20 | } |
| 21 | |
| 22 | func main() { |
| 23 | callclo(1, 2) |
| 24 | } |