]> Cypherpunks repositories - gostls13.git/commitdiff
test: add test for issue 3888.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 22 May 2013 20:45:38 +0000 (22:45 +0200)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 22 May 2013 20:45:38 +0000 (22:45 +0200)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9676043

test/escape2.go

index 511b74a1cca430c53db47bc4f1840aacfdd673c2..ba88f4b3bfdae36650c4566b9c5543466c3b7d61 100644 (file)
@@ -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"
+                       }
+               }()
+       }
+}