diff options
author | Ian Lance Taylor <iant@golang.org> | 2012-04-24 10:17:26 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2012-04-24 10:17:26 -0700 |
commit | 76490cffaf8c54f4e014cc8d74f77abde8cba416 (patch) | |
tree | 60a9fecf1f913dd5f7b68ba405d61745d2391200 /test/reorder.go | |
parent | 78e4d1752e207d4c1663c131eef50842366e77db (diff) | |
download | go-76490cffaf8c54f4e014cc8d74f77abde8cba416.tar.gz go-76490cffaf8c54f4e014cc8d74f77abde8cba416.zip |
test: add test for order of evaluation of map index on left of =
Gccgo used to get this wrong.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6121044
Diffstat (limited to 'test/reorder.go')
-rw-r--r-- | test/reorder.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/reorder.go b/test/reorder.go index 007039e8a9..0cdeebd0f3 100644 --- a/test/reorder.go +++ b/test/reorder.go @@ -19,6 +19,7 @@ func main() { p6() p7() p8() + p9() } var gx []int @@ -119,3 +120,11 @@ func p8() { i := 0 i, x[i], x[5] = 1, 100, 500 } + +func p9() { + m := make(map[int]int) + m[0] = len(m) + if m[0] != 0 { + panic(m[0]) + } +} |