aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2024-03-14 14:24:22 -0700
committerGopher Robot <gobot@golang.org>2024-03-14 22:47:28 +0000
commit412623c53fbb1b3ff29035022ef70374db35e826 (patch)
treecb56e6cf796dcf1e8987834b2c6a653f77ac356a /test
parentd45e8bf403e0296297d4028a75ad61cb309cd12c (diff)
downloadgo-412623c53fbb1b3ff29035022ef70374db35e826.tar.gz
go-412623c53fbb1b3ff29035022ef70374db35e826.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/issue66261.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixedbugs/issue66261.go b/test/fixedbugs/issue66261.go
new file mode 100644
index 0000000000..4ac3c53e5e
--- /dev/null
+++ b/test/fixedbugs/issue66261.go
@@ -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")
+ }
+}