]> Cypherpunks repositories - gostls13.git/commitdiff
test cleanup
authorRob Pike <r@golang.org>
Mon, 7 Jul 2008 17:03:10 +0000 (10:03 -0700)
committerRob Pike <r@golang.org>
Mon, 7 Jul 2008 17:03:10 +0000 (10:03 -0700)
SVN=126120

15 files changed:
test/bugs/bug010.go
test/bugs/bug025.go
test/fixedbugs/bug006.go [moved from test/bugs/bug006.go with 100% similarity]
test/fixedbugs/bug022.go [moved from test/bugs/bug022.go with 89% similarity]
test/fixedbugs/bug035.go [moved from test/bugs/bug035.go with 100% similarity]
test/fixedbugs/bug037.go [moved from test/bugs/bug037.go with 100% similarity]
test/fixedbugs/bug039.go [moved from test/bugs/bug039.go with 100% similarity]
test/fixedbugs/bug043.go [moved from test/bugs/bug043.go with 82% similarity]
test/fixedbugs/bug044.go [moved from test/bugs/bug044.go with 75% similarity]
test/fixedbugs/bug051.go [moved from test/bugs/bug051.go with 100% similarity]
test/golden.out
test/ken/robfunc.go
test/ken/simpconv.go
test/run
test/test0.go

index 6143ca1cdf0885e537edafa870c818f7a8e35c07..43f68748dda6fa5f22934bf8049ee35b9c50be2c 100644 (file)
@@ -12,6 +12,11 @@ func f() (i int, f float) {
        f = 8.0;
        return;
 }
+
+func main() {
+       f(3, float(5))
+}
+
 /*
 bug10.go:5: i undefined
 bug10.go:6: illegal conversion of constant to 020({},<_o001>{<i><int32>INT32;<f><float32>FLOAT32;},{})
index 93c886ae7b135486c12c70f83a28faa718985219..df1c1a7773ed9f3bbcd52f738d477e2a329e6f24 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// $G $D/$F.go || echo BUG: known to fail incorrectly or at least with a bad message
+// $G $D/$F.go && echo BUG: bad exit status - should be 1 - plus extra newline in message
 
 package main
 
similarity index 100%
rename from test/bugs/bug006.go
rename to test/fixedbugs/bug006.go
similarity index 89%
rename from test/bugs/bug022.go
rename to test/fixedbugs/bug022.go
index 5215d35899b401dad024bfc151b789bc74f991fe..229f879219547ef8ad6de59d04ab4c00aee7843d 100644 (file)
@@ -12,6 +12,11 @@ func putint(digits *string) {
        i = digits[7];  // doesn't compile
 }
 
+func main() {
+       s := "asdfasdfasdfasdf";
+       putint(&s);
+}
+
 /*
 bug022.go:8: illegal types for operand
        (*<string>*STRING) INDEXPTR (<int32>INT32)
similarity index 100%
rename from test/bugs/bug035.go
rename to test/fixedbugs/bug035.go
similarity index 100%
rename from test/bugs/bug037.go
rename to test/fixedbugs/bug037.go
similarity index 100%
rename from test/bugs/bug039.go
rename to test/fixedbugs/bug039.go
similarity index 82%
rename from test/bugs/bug043.go
rename to test/fixedbugs/bug043.go
index fee8ebe0b15e8057e0304e8a43f784ce9dbf37d9..a0c7eb1e9e1fdfd87542a8ece34c1a7dc142a450 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// $G $D/$F.go || echo BUG: compilation should succeed
+// $G $D/$F.go && $L $F.$A && ./$A.out
 
 // Forward declarations
 
@@ -15,7 +15,9 @@ func i (x, y int) ;  // this works
 func i (x, y int) {}
 
 func g (x int) float ;  // BUG this doesn't
-func g (x int) float {}
+func g (x int) float { return 0.0 }
 
 func h (x int) (u int, v int) ;  // BUG this doesn't
 func h (x int) (u int, v int) {}
+
+func main() {}
similarity index 75%
rename from test/bugs/bug044.go
rename to test/fixedbugs/bug044.go
index ea9ace38cfef4cb84ca8f2492243407a5eac3c17..789237abe6574349cab4955bd0190df34be712a7 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// $G $D/$F.go || echo BUG: compilation should succeed
+// $G $D/$F.go && $L $F.$A && ./$A.out
 
 package main
 
@@ -24,4 +24,6 @@ func (p *S) M2b() {
   p.M1b();
 }
 
-func (p *S) M1b() int {}  // BUG this doesn't
+func (p *S) M1b() int { return 0 }  // BUG this doesn't
+
+func main() {}
similarity index 100%
rename from test/bugs/bug051.go
rename to test/fixedbugs/bug051.go
index 51ce968a4f2c5ccc91198ba1f16c2d78dfa19857..4f567bc72781d8b65611b6f07bfadff805bc930f 100644 (file)
@@ -10,7 +10,8 @@
 =========== ./func.go
 
 =========== ./func1.go
-BUG: known to succeed incorrectly
+func1.go:10: var a redeclared in this block
+     previous declaration at func1.go:10
 
 =========== ./hashmap.go
 
@@ -44,20 +45,6 @@ BUG: known to fail incorrectly
 =========== ./switch1.go
 
 =========== ./test0.go
-test0.go:48: illegal types for operand: AS
-       (<float32>FLOAT32)
-       (<int32>INT32)
-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
-       (*<Point>{})
-       (<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
-test0.go:54: illegal types for operand: AS
-       (<Point>{<x><int32>INT32;<y><int32>INT32;<Point_Initialize>120({},{}){};<Point_Distance>101({},{}){};})
-       ({})
-BUG: known to fail incorrectly
 
 =========== ./turing.go
 Hello World!
@@ -118,35 +105,19 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
 
 =========== ken/strvar.go
 
-=========== bugs/bug006.go
-zero
- fail
-BUG: known to fail incorrectly
-
 =========== bugs/bug010.go
-bugs/bug010.go:7: i: undefined
-bugs/bug010.go:8: illegal conversion of constant to 002({},{}){}
-bugs/bug010.go:8: illegal types for operand: AS
-       (002({},{}){<i><int32>INT32;<f><float32>FLOAT32;})
-bugs/bug010.go:9: error in shape across assignment
+bugs/bug010.go:13: error in shape across CALL
 BUG: known to fail incorrectly
 
 =========== bugs/bug015.go
 BUG: known to succeed incorrectly
 
-=========== bugs/bug022.go
-bugs/bug022.go:8: illegal types for operand: INDEXPTR
-       (*<string>*STRING)
-bugs/bug022.go:8: illegal types for operand: AS
-       (<uint8>UINT8)
-BUG: known to fail incorrectly
-
 =========== bugs/bug023.go
 
 =========== bugs/bug025.go
-bugs/bug025.go:7: fatal error: dumpexportvar: oname nil: Foo
+bugs/bug025.go:7: variable exported but not defined: Foo
 
-BUG: known to fail incorrectly or at least with a bad message
+BUG: bad exit status - should be 1 - plus extra newline in message
 
 =========== bugs/bug026.go
 sys·printstring: main·sigs_I: not defined
@@ -173,30 +144,11 @@ BUG: compilation succeeds incorrectly
 =========== bugs/bug034.go
 BUG: compilation succeeds incorrectly
 
-=========== bugs/bug035.go
-BUG: compilation succeeds incorrectly
-
-=========== bugs/bug037.go
-BUG: compilation succeeds incorrectly
-
-=========== bugs/bug039.go
-BUG: compilation succeeds incorrectly
-
 =========== bugs/bug041.go
 BUG: compilation succeeds incorrectly
 
 =========== bugs/bug042.go
 bugs/bug042.go:6: syntax error
-bugs/bug042.go:15: syntax error
-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
-BUG: compilation should succeed
-
-=========== bugs/bug044.go
-bugs/bug044.go:23: error in shape across assignment
 BUG: compilation should succeed
 
 =========== bugs/bug046.go
@@ -229,20 +181,6 @@ bugs/bug050.go:3: package statement must be first
 sys.6:1 bugs/bug050.go:3: 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
 SIGSEGV: segmentation violation
 Faulting address: 0x1
@@ -252,27 +190,6 @@ pc: 0x1349
        main·main(1, 0, 1606416464, ...)
        main·main(0x1, 0x7fff5fbff850, 0x1, ...)
 
-rax     0x1
-rbx     0x7
-rcx     0x7fff5fbff7e8
-rdx     0x3
-rdi     0x7fff5fbff810
-rsi     0x4950
-rbp     0x13ffc00
-rsp     0x7fff5fbff7e0
-r8      0x0
-r9      0x0
-r10     0x0
-r11     0x216
-r12     0x0
-r13     0x0
-r14     0x0
-r15     0x68f0
-rip     0x1349
-rflags  0x10206
-cs      0x27
-fs      0x10
-gs      0x48
 BUG: incorrect code for division
 
 =========== bugs/bug053.go
@@ -317,15 +234,6 @@ BUG: known to succeed incorrectly
 =========== bugs/bug063.go
 bugs/bug063.go:5: illegal combination of literals XOR 7
 bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: expression must be a constant
-bugs/bug063.go:5: fatal error: too many errors
 BUG: should compile without problems
 
 =========== bugs/bug064.go
@@ -346,6 +254,8 @@ BUG: compilation should succeed
 
 =========== fixedbugs/bug005.go
 
+=========== fixedbugs/bug006.go
+
 =========== fixedbugs/bug007.go
 
 =========== fixedbugs/bug008.go
@@ -368,6 +278,8 @@ BUG: compilation should succeed
 
 =========== fixedbugs/bug021.go
 
+=========== fixedbugs/bug022.go
+
 =========== fixedbugs/bug024.go
 
 =========== fixedbugs/bug028.go
@@ -376,14 +288,35 @@ BUG: compilation should succeed
 
 =========== fixedbugs/bug031.go
 
+=========== fixedbugs/bug035.go
+fixedbugs/bug035.go:6: var i redeclared in this block
+     previous declaration at fixedbugs/bug035.go:5
+fixedbugs/bug035.go:7: var f redeclared in this block
+     previous declaration at fixedbugs/bug035.go:5
+
 =========== fixedbugs/bug036.go
 
+=========== fixedbugs/bug037.go
+fixedbugs/bug037.go:6: vlong: undefined
+fixedbugs/bug037.go:6: fatal error: addvar: n=NAME-s G0 a(1) l(199) t=<T> nil
+
 =========== fixedbugs/bug038.go
 
+=========== fixedbugs/bug039.go
+fixedbugs/bug039.go:6: var x redeclared in this block
+     previous declaration at fixedbugs/bug039.go:5
+
 =========== fixedbugs/bug040.go
 
+=========== fixedbugs/bug043.go
+
+=========== fixedbugs/bug044.go
+
 =========== fixedbugs/bug045.go
 
+=========== fixedbugs/bug051.go
+fixedbugs/bug051.go:10: expression must be a constant
+
 =========== fixedbugs/bug056.go
 
 =========== fixedbugs/bug058.go
index c6b1a10c448a4d0ed2f89561d0ca8e3c389dc85d..d888414065199dc64657574d324b55d25f2de72f 100644 (file)
@@ -40,7 +40,7 @@ func f7(a int) (int, float) {
 }
 
 
-func f8(a int) (a int, b float) {
+func f8(a int) (x int, y float) {
        return 8, 8.0;
 }
 
@@ -53,7 +53,7 @@ func (t *T) m10(a int, b float) int {
 }
 
 
-func f9(a int) (i int, f float) {
+func f9(a int) (in int, fl float) {
        i := 9;
        f := float(9);
        return i, f;
index 895024e5bfd6533d7b9e38e3b279f38faf29e391..401ae763d40985321e3e706de7b133ec08487f64 100644 (file)
@@ -6,6 +6,8 @@
 
 package main
 
+type vlong int64;
+
 func
 main()
 {
index ee014269adde0fe8b3e308ec55d1e27d494c61c4..a7ce63dde16c220087b630d30eddac3e3b27ddc5 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -32,7 +32,8 @@ do
                        echo >&2 fail: $i
                fi
        done
-done > run.out
+done | # clean up some stack noise
+       egrep -v '^(r[0-9a-z]+|[cfg]s)  +0x' > run.out
 
 case $failed in
 1)
index 4d7b0df1f6b762364b37e765633d1815512b0047..a3691fb469c827af8d5ad0fb411570e914bb09d0 100644 (file)
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package Test0
+package main
 
 const
   a_const = 0
@@ -26,8 +26,9 @@ type (
   Point2 Point
 )
 
-func (p *Point) Initialize(x, y int) {
+func (p *Point) Initialize(x, y int) *Point {
   p.x, p.y = x, y;
+  return p;
 }
 
 func (p *Point) Distance() int {
@@ -54,7 +55,7 @@ func swap(x, y int) (u, v int) {
 }
 
 func control_structs() {
-  var p Point = new(Point).Initialize(2, 3);
+  var p *Point = new(Point).Initialize(2, 3);
   i := p.Distance();
   var f float = 0.3;
   for {}
@@ -78,3 +79,6 @@ func control_structs() {
     break;
   }
 }
+
+func main() {
+}