summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-09-09 01:01:39 -0700
committerRuss Cox <rsc@golang.org>2009-09-09 01:01:39 -0700
commit14db527e09ecd8acfecc1cb7cfd5640ffd83dcd2 (patch)
tree60f5a7934fab0fa8320df6c43c32e90ba7b7708a /test
parent2c07efbb75ff849ac32bdcb2d2e13094da010c7f (diff)
downloadgo-14db527e09ecd8acfecc1cb7cfd5640ffd83dcd2.tar.gz
defining package block names must override
universe block names. BUG=2097244 R=ken OCL=34295 CL=34473
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug186.go3
-rw-r--r--test/fixedbugs/bug194.go (renamed from test/bugs/bug194.go)0
-rw-r--r--test/golden.out4
-rw-r--r--test/rename.go75
-rw-r--r--test/rename1.go48
5 files changed, 124 insertions, 6 deletions
diff --git a/test/fixedbugs/bug186.go b/test/fixedbugs/bug186.go
index a54934e2b..dde794a5d 100644
--- a/test/fixedbugs/bug186.go
+++ b/test/fixedbugs/bug186.go
@@ -12,7 +12,6 @@ func f(x int) { }
func main() {
f(X);
- f(iota); // ERROR "iota.*initializer"
+ f(iota); // ERROR "iota"
f(X);
- f(iota); // ERROR "iota.*initializer"
}
diff --git a/test/bugs/bug194.go b/test/fixedbugs/bug194.go
index 5f101440e..5f101440e 100644
--- a/test/bugs/bug194.go
+++ b/test/fixedbugs/bug194.go
diff --git a/test/golden.out b/test/golden.out
index a5eb85bb3..148471660 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -163,10 +163,6 @@ BUG: should compile
=========== bugs/bug193.go
BUG: errchk: bugs/bug193.go:14: missing expected error: 'shift'
-=========== bugs/bug194.go
-bugs/bug194.go:15: array index must be non-negative integer constant
-BUG should compile and run
-
=========== bugs/bug196.go
too many calls: 5
panic PC=xxx
diff --git a/test/rename.go b/test/rename.go
new file mode 100644
index 000000000..8d5441375
--- /dev/null
+++ b/test/rename.go
@@ -0,0 +1,75 @@
+// $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
+
+import "fmt"
+
+func main() {
+ n :=
+ bool +
+ byte +
+ float +
+ float32 +
+ float64 +
+ int +
+ int8 +
+ int16 +
+ int32 +
+ int64 +
+ uint +
+ uint8 +
+ uint16 +
+ uint32 +
+ uint64 +
+ uintptr +
+ true +
+ false +
+ iota +
+ nil +
+ cap +
+ len +
+ make +
+ new +
+ panic +
+ panicln +
+ print +
+ println;
+ if n != 28*29/2 {
+ fmt.Println("BUG: wrong n", n, 28*29/2)
+ }
+}
+
+const (
+ bool = 1;
+ byte = 2;
+ float = 3;
+ float32 = 4;
+ float64 = 5;
+ int = 6;
+ int8 = 7;
+ int16 = 8;
+ int32 = 9;
+ int64 = 10;
+ uint = 11;
+ uint8 = 12;
+ uint16 = 13;
+ uint32 = 14;
+ uint64 = 15;
+ uintptr = 16;
+ true = 17;
+ false = 18;
+ iota = 19;
+ nil = 20;
+ cap = 21;
+ len = 22;
+ make = 23;
+ new = 24;
+ panic = 25;
+ panicln = 26;
+ print = 27;
+ println = 28;
+)
diff --git a/test/rename1.go b/test/rename1.go
new file mode 100644
index 000000000..eb98e7acc
--- /dev/null
+++ b/test/rename1.go
@@ -0,0 +1,48 @@
+// errchk $G -e $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 main() {
+ var n byte; // ERROR "not a type"
+ var y = float(0); // ERROR "cannot call"
+ const (
+ a = 1+iota; // ERROR "string"
+ )
+
+}
+
+const (
+ bool = 1;
+ byte = 2;
+ float = 3;
+ float32 = 4;
+ float64 = 5;
+ int = 6;
+ int8 = 7;
+ int16 = 8;
+ int32 = 9;
+ int64 = 10;
+ uint = 11;
+ uint8 = 12;
+ uint16 = 13;
+ uint32 = 14;
+ uint64 = 15;
+ uintptr = 16;
+ true = 17;
+ false = 18;
+ iota = "abc";
+ nil = 20;
+ cap = 21;
+ len = 22;
+ make = 23;
+ new = 24;
+ panic = 25;
+ panicln = 26;
+ print = 27;
+ println = 28;
+)
+