]> Cypherpunks repositories - gostls13.git/commitdiff
fix some tests
authorRob Pike <r@golang.org>
Thu, 3 Jul 2008 23:48:59 +0000 (16:48 -0700)
committerRob Pike <r@golang.org>
Thu, 3 Jul 2008 23:48:59 +0000 (16:48 -0700)
SVN=125987

test/bugs/bug064.go [new file with mode: 0644]
test/golden.out
test/simassign.go

diff --git a/test/bugs/bug064.go b/test/bugs/bug064.go
new file mode 100644 (file)
index 0000000..41c130d
--- /dev/null
@@ -0,0 +1,23 @@
+// $G $D/$F.go || echo BUG: compilation should succeed
+
+// 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
+swap(x, y int) (u, v int) {
+       return y, x
+}
+
+func
+main()
+{
+       a := 1;
+       b := 2;
+       a, b = swap(swap(a, b));
+       if a != 2 || b != 1 {
+               panic "bad swap";
+       }
+}
index d5bd978390018b13ddf9f413491eb5ed3107eed9..c0d6c054b3d24cae2f8d2974fdf964bba4c159dd 100644 (file)
@@ -318,19 +318,25 @@ BUG: known to fail incorrectly
 BUG: known to succeed incorrectly
 
 =========== bugs/bug063.go
-bugs/bug063.go:4: illegal combination of literals XOR 7
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: expression must be a constant
-bugs/bug063.go:4: fatal error: too many errors
+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
+bugs/bug064.go:15: illegal types for operand: CALL
+       (<int32>INT32)
+       ({<u><int32>INT32;<v><int32>INT32;})
+BUG: compilation should succeed
+
 =========== fixedbugs/bug000.go
 
 =========== fixedbugs/bug001.go
index aeb988d7dbcefd27b55305eacf73d7f1db6637af..5b8c3f39fa4e9a50398c389b6f978277ce2d255b 100644 (file)
@@ -33,7 +33,13 @@ testit() bool
                i == 9;
 }
 
-func main()
+func
+swap(x, y int) (u, v int) {
+       return y, x
+}
+
+func
+main()
 {
        a = 1;
        b = 2;
@@ -65,4 +71,13 @@ func main()
                printit();
                panic;
        }
+
+       a, b = swap(1, 2);
+       if a != 2 || b != 1 {
+               panic "bad swap";
+       }
+//BUG  a, b = swap(swap(a, b));
+//     if a != 2 || b != 1 {
+//             panic "bad swap";
+//     }
 }