summaryrefslogtreecommitdiff
path: root/test/escape2.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/escape2.go')
-rw-r--r--test/escape2.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/escape2.go b/test/escape2.go
index 511b74a1c..ba88f4b3b 100644
--- a/test/escape2.go
+++ b/test/escape2.go
@@ -1325,3 +1325,15 @@ func foo142() {
t := new(Tm) // ERROR "escapes to heap"
gf = t.M // ERROR "t.M escapes to heap"
}
+
+// issue 3888.
+func foo143() {
+ for i := 0; i < 1000; i++ {
+ func() { // ERROR "func literal does not escape"
+ for i := 0; i < 1; i++ {
+ var t Tm
+ t.M() // ERROR "t does not escape"
+ }
+ }()
+ }
+}