summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug454.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2013-03-04 21:27:43 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-03-04 21:27:43 +0100
commitad47422646a18ffcb47cec916ef7393c923f2e76 (patch)
tree7c7861fb3d9539d61c1dcfd5b8dadee974c25760 /test/fixedbugs/bug454.go
parent2c8d5d584a79781ca41bb6f4b396893fbbac5b97 (diff)
parent04b08da9af0c450d645ab7389d1467308cfc2db8 (diff)
downloadgolang-ad47422646a18ffcb47cec916ef7393c923f2e76.tar.gz
Merge tag 'upstream/1.1_hg20130304' into debian-sid
Upstream version 1.1~hg20130304
Diffstat (limited to 'test/fixedbugs/bug454.go')
-rw-r--r--test/fixedbugs/bug454.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fixedbugs/bug454.go b/test/fixedbugs/bug454.go
new file mode 100644
index 000000000..a10abba8b
--- /dev/null
+++ b/test/fixedbugs/bug454.go
@@ -0,0 +1,21 @@
+// run
+
+// Copyright 2012 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 4173
+
+package main
+
+func main() {
+ var arr *[10]int
+ s := 0
+ for i, _ := range arr {
+ // used to panic trying to access arr[i]
+ s += i
+ }
+ if s != 45 {
+ println("BUG")
+ }
+}