From: Rémy Oudompheng Date: Wed, 22 May 2013 20:45:38 +0000 (+0200) Subject: test: add test for issue 3888. X-Git-Tag: go1.2rc2~1433 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3577398f82980a1c47689b932e728497839abf84;p=gostls13.git test: add test for issue 3888. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/9676043 --- diff --git a/test/escape2.go b/test/escape2.go index 511b74a1cc..ba88f4b3bf 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" + } + }() + } +}