aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/go.test/test/typecheck.go
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/go.test/test/typecheck.go')
-rw-r--r--gcc-4.9/gcc/testsuite/go.test/test/typecheck.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/go.test/test/typecheck.go b/gcc-4.9/gcc/testsuite/go.test/test/typecheck.go
new file mode 100644
index 000000000..a2ad91ff4
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/go.test/test/typecheck.go
@@ -0,0 +1,18 @@
+// errorcheck
+
+// Verify that the Go compiler will not
+// die after running into an undefined
+// type in the argument list for a
+// function.
+// Does not compile.
+
+package main
+
+func mine(int b) int { // ERROR "undefined.*b"
+ return b + 2 // ERROR "undefined.*b"
+}
+
+func main() {
+ mine() // GCCGO_ERROR "not enough arguments"
+ c = mine() // ERROR "undefined.*c|not enough arguments" "cannot assign to c"
+}