1
0
mirror of https://github.com/golang/go synced 2024-11-11 19:21:37 -07:00

test/fixedbugs: add regress test for inlining failure

Still investigating, but adding the minimized reproducer as a regress
test case for now.

Updates #66261.

Change-Id: I20715b731f8c5b95616513d4a13e3ae083709031
Reviewed-on: https://go-review.googlesource.com/c/go/+/571815
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Matthew Dempsky 2024-03-14 14:24:22 -07:00 committed by Gopher Robot
parent d45e8bf403
commit 412623c53f

View File

@ -0,0 +1,26 @@
// run
// Copyright 2024 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func main() {
env := func() func(*bool) func() int {
return func() func(*bool) func() int {
return func(ptr *bool) func() int {
return func() int {
*ptr = true
return 0
}
}
}()
}()
var ok bool
func(int) {}(env(&ok)())
if !ok {
panic("FAIL")
}
}