test: add test for issue 3888.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/9676043
This commit is contained in:
Rémy Oudompheng 2013-05-22 22:45:38 +02:00
parent 1beb791934
commit 3577398f82

View 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"
}
}()
}
}