aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Donizetti <alb.donizetti@gmail.com>2017-04-14 15:06:03 +0200
committerBrad Fitzpatrick <bradfitz@golang.org>2017-04-14 14:16:09 +0000
commit6266b0f08f46de10abfb3d27748bdf1fdebcbba2 (patch)
tree7e4ecb5924c8dc460b5ce68c89b94c4f44ac6f42
parent3b6ecdf93463dd09506596872f5147a781b416b1 (diff)
downloadgo-6266b0f08f46de10abfb3d27748bdf1fdebcbba2.tar.xz
cmd/compile: add test for Issue 12536
The fixedbugs/issue12536.go file was erroneously deleted just before committing the patch that fixed the issue (CL 14400). That's an easy test and there's a small reproducer in the issue, add it back. Updates #12536 Change-Id: Ib7b0cd245588299e9a5469e1d75805fd0261ce1a Reviewed-on: https://go-review.googlesource.com/40712 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--test/fixedbugs/issue12536.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/fixedbugs/issue12536.go b/test/fixedbugs/issue12536.go
new file mode 100644
index 0000000000..ceeaec4360
--- /dev/null
+++ b/test/fixedbugs/issue12536.go
@@ -0,0 +1,22 @@
+// compile
+
+// Copyright 2017 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 12536: compiler crashes while checking keys in a map literal for equality
+
+package p
+
+func main() {
+ m1 := map[interface{}]interface{}{
+ nil: 0,
+ true: 1,
+ }
+ m2 := map[interface{}]interface{}{
+ true: 1,
+ nil: 0,
+ }
+ println(len(m1))
+ println(len(m2))
+}