]> Cypherpunks repositories - gostls13.git/commitdiff
- added 2 bug tests
authorRobert Griesemer <gri@golang.org>
Tue, 17 Jun 2008 23:04:33 +0000 (16:04 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 17 Jun 2008 23:04:33 +0000 (16:04 -0700)
SVN=123220

test/bugs/bug051.go [new file with mode: 0644]
test/bugs/bug052.go [new file with mode: 0644]
test/golden.out

diff --git a/test/bugs/bug051.go b/test/bugs/bug051.go
new file mode 100644 (file)
index 0000000..c5b9606
--- /dev/null
@@ -0,0 +1,15 @@
+// errchk $G $D/$F.go
+
+// 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 f() int {
+  return 0;
+}
+
+func main() {
+  const n = f();  // should report only one error
+}
diff --git a/test/bugs/bug052.go b/test/bugs/bug052.go
new file mode 100644 (file)
index 0000000..07c651d
--- /dev/null
@@ -0,0 +1,20 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out
+
+// 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() {
+  c := 10;
+  d := 7;
+  var x [10]int;
+  i := 0;
+  /* this works:
+  q := c/d;
+  x[i] = q;
+  */
+  // this doesn't:
+  x[i] = c/d;  // BUG segmentation fault
+}
index c2728e6d1c4443fd068e190e3d1111efc1860a4a..631a74762bd8d4858e1827889d9a8faa7b1d45b8 100644 (file)
@@ -47,10 +47,10 @@ test0.go:49: illegal types for operand: AS
        (<float32>FLOAT32)
        (<int32>INT32)
 test0.go:50: error in shape across assignment
-test0.go:55: illegal types for operand: CALLMETH
+test0.go:47: illegal types for operand: CALLMETH
        (*<Point>{})
        (<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
-test0.go:54: illegal types for operand: AS
+test0.go:47: illegal types for operand: AS
        (<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
        ({})
 BUG: known to fail incorrectly
@@ -139,7 +139,6 @@ BUG: known to succeed incorrectly
 =========== bugs/bug022.go
 bugs/bug022.go:8: illegal types for operand: INDEXPTR
        (*<string>*STRING)
-       (<int32>INT32)
 BUG: known to fail incorrectly
 
 =========== bugs/bug023.go
@@ -210,7 +209,7 @@ BUG: compilation should succeed
 
 =========== bugs/bug043.go
 bugs/bug043.go:14: error in shape across assignment
-bugs/bug043.go:17: error in shape across assignment
+bugs/bug043.go:14: error in shape across assignment
 BUG: compilation should succeed
 
 =========== bugs/bug044.go
@@ -251,6 +250,23 @@ bugs/bug050.go:3: package statement must be first
 sys.6:1 bugs/bug050.go:2: syntax error
 BUG: segfault
 
+=========== bugs/bug051.go
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: expression must be a constant
+bugs/bug051.go:10: fatal error: too many errors
+BUG: infinite loop in error reporting
+
+=========== bugs/bug052.go
+BUG: incorrect code for division
+
 =========== fixedbugs/bug000.go
 
 =========== fixedbugs/bug001.go