]> Cypherpunks repositories - gostls13.git/commitdiff
bugs from old gri mail
authorRuss Cox <rsc@golang.org>
Thu, 30 Oct 2008 02:34:47 +0000 (19:34 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 30 Oct 2008 02:34:47 +0000 (19:34 -0700)
R=gri
OCL=18093
CL=18093

test/bugs/bug115.go [new file with mode: 0644]
test/bugs/bug116.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug115.go b/test/bugs/bug115.go
new file mode 100644 (file)
index 0000000..16b22d7
--- /dev/null
@@ -0,0 +1,14 @@
+// $G $D/$F.go || echo BUG: bug115 should compile
+
+// Copyright 2009 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
+
+func isuint(i uint) { }
+
+func main() {
+       i := ^uint(0);
+       isuint(i);
+}
diff --git a/test/bugs/bug116.go b/test/bugs/bug116.go
new file mode 100644 (file)
index 0000000..32c99d4
--- /dev/null
@@ -0,0 +1,34 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug116
+
+// Copyright 2009 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
+
+func main() {
+       bad := false;
+       if (-5>>1) != -3 {
+               println("-5>>1 =", -5>>1, "want -3");
+               bad = true;
+       }
+       if (-4>>1) != -2 {
+               println("-4>>1 =", -4>>1, "want -2");
+               bad = true;
+       }
+       if (-3>>1) != -2 {
+               println("-3>>1 =", -3>>1, "want -2");
+               bad = true;
+       }
+       if (-2>>1) != -1 {
+               println("-2>>1 =", -2>>1, "want -1");
+               bad = true;
+       }
+       if (-1>>1) != -1 {
+               println("-1>>1 =", -1>>1, "want -1");
+               bad = true;
+       }
+       if bad {
+               panicln("errors");
+       }
+}
index b144e0d2fdf0c8e455b3ef257918ec2c3e1a7582..219d2c4b5a8c1e1c26553fc829f71369d1d0a8c2 100644 (file)
@@ -264,3 +264,19 @@ M
 
 =========== fixedbugs/bug103.go
 fixedbugs/bug103.go:8: function requires a return type
+
+=========== bugs/bug115.go
+bugs/bug115.go:8: overflow converting constant to uint
+BUG: bug115 should compile
+
+=========== bugs/bug116.go
+-5>>1 = -2 want -3
+-4>>1 = -3 want -2
+-3>>1 = -1 want -2
+-2>>1 = -2 want -1
+-1>>1 = 0 want -1
+errors
+
+panic on line 92 PC=xxx
+BUG: bug116
+