summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug208.go4
-rw-r--r--test/varerr.go14
2 files changed, 16 insertions, 2 deletions
diff --git a/test/fixedbugs/bug208.go b/test/fixedbugs/bug208.go
index 0a05d80c1..13b040084 100644
--- a/test/fixedbugs/bug208.go
+++ b/test/fixedbugs/bug208.go
@@ -11,10 +11,10 @@ type T struct
f int;
}
-var _ = T{f: 1}
-
// 6g used to get confused by the f:1 above
// and allow uses of f that would be silently
// dropped during the compilation.
var _ = f; // ERROR "undefined"
+var _ = T{f: 1}
+
diff --git a/test/varerr.go b/test/varerr.go
new file mode 100644
index 000000000..32f33ecc7
--- /dev/null
+++ b/test/varerr.go
@@ -0,0 +1,14 @@
+// errchk $G $D/$F.go
+
+// Copyright 2010 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() {
+ _ = asdf // ERROR "undefined: asdf"
+
+ new = 1 // ERROR "use of builtin new not in function call"
+}
+