summaryrefslogtreecommitdiff
path: root/test/reorder.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2012-04-24 10:17:26 -0700
committerIan Lance Taylor <iant@golang.org>2012-04-24 10:17:26 -0700
commit1fcecdf11ad97111d33238a2e6cf193516529c1a (patch)
tree24aa667c66d3c684755815bb436da6d2ebf82f49 /test/reorder.go
parentdca42c6a562bf5dd39814925b87b01ee18c7977b (diff)
downloadgo-1fcecdf11ad97111d33238a2e6cf193516529c1a.tar.gz
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 http://codereview.appspot.com/6121044
Diffstat (limited to 'test/reorder.go')
-rw-r--r--test/reorder.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/reorder.go b/test/reorder.go
index 007039e8a..0cdeebd0f 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])
+ }
+}