summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2008-06-06 15:53:14 -0700
committerRobert Griesemer <gri@golang.org>2008-06-06 15:53:14 -0700
commit6e89bead2cd159187c1b8b04969154da4365e654 (patch)
tree43028db105ceb59b039061a046904bd668df2b7e /test
parent161628d8fdf3518376c93c79558c9f72aac13d57 (diff)
downloadgo-6e89bead2cd159187c1b8b04969154da4365e654.tar.gz
- fixed a few tests and added 3 incorrectly succeeding tests
- updated go_lang.txt to be more uniform and match the implementation - made makehtml work on Mac - fixed a couple of bugs in go.atg SVN=121520
Diffstat (limited to 'test')
-rw-r--r--test/func.go4
-rw-r--r--test/func1.go16
-rw-r--r--test/golden.out9
-rw-r--r--test/if.go2
-rw-r--r--test/if1.go14
-rw-r--r--test/switch.go2
-rw-r--r--test/switch1.go16
7 files changed, 59 insertions, 4 deletions
diff --git a/test/func.go b/test/func.go
index 0bb551f45..e5cb1e551 100644
--- a/test/func.go
+++ b/test/func.go
@@ -36,12 +36,12 @@ func f6(a int) (r int) {
return 6;
}
-func f7(a int) (int, float) {
+func f7(a int) (x int, y float) {
return 7, 7.0;
}
-func f8(a int) (a int, b float) {
+func f8(a int) (x int, y float) {
return 8, 8.0;
}
diff --git a/test/func1.go b/test/func1.go
new file mode 100644
index 000000000..2f92c35b7
--- /dev/null
+++ b/test/func1.go
@@ -0,0 +1,16 @@
+// errchk $G $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 f1(a int) (int, float) { // BUG multiple return values must have names
+ return 7, 7.0;
+}
+
+
+func f2(a int) (a int, b float) { // BUG return value names must be different from parameter names
+ return 8, 8.0;
+}
diff --git a/test/golden.out b/test/golden.out
index 56105a57c..cc611d402 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -23,6 +23,9 @@ main_f4: doasm: notfound from=75 to=10 (24) IDIVL $2,AX
main_f4: doasm: notfound from=75 to=10 (24) IDIVL $2,AX
BUG: known to fail incorrectly
+=========== ./func1.go
+BUG: known to succeed incorrectly
+
=========== ./hashmap.go
hashmap.go:46: fatal error: optoas: no entry LSH-<uint32>UINT32
BUG: known to fail incorrectly
@@ -32,6 +35,9 @@ hello, world
=========== ./if.go
+=========== ./if1.go
+BUG: known to succeed incorrectly
+
=========== ./int_lit.go
int_lit.go:5: syntax error
BUG: known to fail incorrectly
@@ -52,6 +58,9 @@ BUG: known to fail incorrectly
=========== ./switch.go
+=========== ./switch1.go
+BUG: known to succeed incorrectly
+
=========== ./test0.go
test0.go:23: addtyp: renaming Point/<Point>{<x><int32>INT32;<y><int32>INT32;} to Point2/<Point2>FORW
test0.go:48: illegal types for operand
diff --git a/test/if.go b/test/if.go
index 2018f7018..beb7d6b0f 100644
--- a/test/if.go
+++ b/test/if.go
@@ -50,7 +50,7 @@ func main() {
assertequal(count, 1, "if empty");
count = 0;
- if one := 1; {
+ if one := 1; true {
count = count + one;
}
assertequal(count, 1, "if empty one");
diff --git a/test/if1.go b/test/if1.go
new file mode 100644
index 000000000..67a58cd80
--- /dev/null
+++ b/test/if1.go
@@ -0,0 +1,14 @@
+// $G $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() {
+ count := 0;
+ if one := 1; { // BUG if there is a simple stat, the condition must be present
+ count = count + one;
+ }
+}
diff --git a/test/switch.go b/test/switch.go
index 1184230db..602265631 100644
--- a/test/switch.go
+++ b/test/switch.go
@@ -35,7 +35,7 @@ func main() {
case i5 > x: assert(false, ">");
}
- switch x := 5; { // BUG?: true should not be necessary but now made mandatory in go_lang.txt
+ switch x := 5; true {
case i5 < x: assert(false, "<");
case i5 == x: assert(true, "!");
case i5 > x: assert(false, ">");
diff --git a/test/switch1.go b/test/switch1.go
new file mode 100644
index 000000000..f2f006f9b
--- /dev/null
+++ b/test/switch1.go
@@ -0,0 +1,16 @@
+// $G $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() {
+ i := 0;
+ switch x := 5; { // BUG if there is a simple stat, the condition must be present
+ case i < x:
+ case i == x:
+ case i > x:
+ }
+}