summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2010-05-21 14:53:54 -0700
committerRobert Griesemer <gri@golang.org>2010-05-21 14:53:54 -0700
commitbd19d7da2d4cd87bba3ecae8c5815c9cebc1d494 (patch)
tree3ee77518154ea559dfc74e4635129495946a48a2 /test
parent4dd51cd5eb4fa58a4e8118b4f818c15356fa9cc0 (diff)
downloadgolang-bd19d7da2d4cd87bba3ecae8c5815c9cebc1d494.tar.gz
issue 789: keep test case
R=rsc CC=golang-dev http://codereview.appspot.com/1242045
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug276.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/fixedbugs/bug276.go b/test/fixedbugs/bug276.go
new file mode 100644
index 000000000..844a6b238
--- /dev/null
+++ b/test/fixedbugs/bug276.go
@@ -0,0 +1,23 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG code should run
+
+// 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.
+
+// Test case for issue 789. The bug only appeared for GOARCH=386.
+
+package main
+
+func main() {
+ i := 0
+ x := 0
+
+ a := (x & 1) << uint(1-i)
+
+ s := uint(1-i)
+ b := (x & 1) << s
+
+ if a != b {
+ panic(0)
+ }
+}