summaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug259.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-02-26 13:15:29 -0800
committerRuss Cox <rsc@golang.org>2010-02-26 13:15:29 -0800
commit9fcfa52c9e115316eb9196e7764dd009c5907c3c (patch)
tree45f55746c047f21ff182ad6b59fba2a019e5f19a /test/fixedbugs/bug259.go
parent0a4f9921d7218f52e87887371d072177398afeb7 (diff)
downloadgo-9fcfa52c9e115316eb9196e7764dd009c5907c3c.tar.gz
8g: make a[byte(x)] truncate x
R=ken2 CC=golang-dev http://codereview.appspot.com/223069
Diffstat (limited to 'test/fixedbugs/bug259.go')
-rw-r--r--test/fixedbugs/bug259.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/bug259.go b/test/fixedbugs/bug259.go
new file mode 100644
index 000000000..d148fb3a0
--- /dev/null
+++ b/test/fixedbugs/bug259.go
@@ -0,0 +1,16 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2010 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.
+
+package main
+
+import "fmt"
+
+var x = uint32(0x01020304)
+var y = [...]uint32{1,2,3,4,5}
+
+func main() {
+ fmt.Sprint(y[byte(x)])
+}