Commit 8205bfb5 authored by Dmitry Vyukov's avatar Dmitry Vyukov

test: fix build

Fix build after http://golang.org/cl/5297
The compiler was changed to not print implicit map capacity in error messages.

Change-Id: I852f668680c3c69c5eecc7964e46202a97014d6a
Reviewed-on: https://go-review.googlesource.com/8212Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
parent 6d9fd7e6
...@@ -11,7 +11,7 @@ package escape ...@@ -11,7 +11,7 @@ package escape
var sink interface{} var sink interface{}
func map0() { func map0() {
m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) does not escape" m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
// BAD: i should not escape // BAD: i should not escape
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
// BAD: j should not escape // BAD: j should not escape
...@@ -21,7 +21,7 @@ func map0() { ...@@ -21,7 +21,7 @@ func map0() {
} }
func map1() *int { func map1() *int {
m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) does not escape" m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
// BAD: i should not escape // BAD: i should not escape
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
j := 0 // ERROR "moved to heap: j" j := 0 // ERROR "moved to heap: j"
...@@ -30,7 +30,7 @@ func map1() *int { ...@@ -30,7 +30,7 @@ func map1() *int {
} }
func map2() map[*int]*int { func map2() map[*int]*int {
m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) escapes to heap" m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) escapes to heap"
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
j := 0 // ERROR "moved to heap: j" j := 0 // ERROR "moved to heap: j"
m[&i] = &j // ERROR "&i escapes to heap" "&j escapes to heap" m[&i] = &j // ERROR "&i escapes to heap" "&j escapes to heap"
...@@ -38,7 +38,7 @@ func map2() map[*int]*int { ...@@ -38,7 +38,7 @@ func map2() map[*int]*int {
} }
func map3() []*int { func map3() []*int {
m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) does not escape" m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
// BAD: j should not escape // BAD: j should not escape
j := 0 // ERROR "moved to heap: j" j := 0 // ERROR "moved to heap: j"
...@@ -51,7 +51,7 @@ func map3() []*int { ...@@ -51,7 +51,7 @@ func map3() []*int {
} }
func map4() []*int { func map4() []*int {
m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) does not escape" m := make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
// BAD: i should not escape // BAD: i should not escape
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
j := 0 // ERROR "moved to heap: j" j := 0 // ERROR "moved to heap: j"
...@@ -75,7 +75,7 @@ func map5(m map[*int]*int) { // ERROR "m does not escape" ...@@ -75,7 +75,7 @@ func map5(m map[*int]*int) { // ERROR "m does not escape"
func map6(m map[*int]*int) { // ERROR "m does not escape" func map6(m map[*int]*int) { // ERROR "m does not escape"
if m != nil { if m != nil {
m = make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int, 0\) does not escape" m = make(map[*int]*int) // ERROR "make\(map\[\*int\]\*int\) does not escape"
} }
i := 0 // ERROR "moved to heap: i" i := 0 // ERROR "moved to heap: i"
j := 0 // ERROR "moved to heap: j" j := 0 // ERROR "moved to heap: j"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment