summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test/test/syntax
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/go.test/test/syntax
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/go.test/test/syntax')
-rw-r--r--gcc/testsuite/go.test/test/syntax/forvar.go10
-rw-r--r--gcc/testsuite/go.test/test/syntax/import.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/interface.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi1.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi2.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi3.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi4.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi5.go13
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi6.go13
-rw-r--r--gcc/testsuite/go.test/test/syntax/semi7.go14
-rw-r--r--gcc/testsuite/go.test/test/syntax/topexpr.go20
-rw-r--r--gcc/testsuite/go.test/test/syntax/vareq.go10
-rw-r--r--gcc/testsuite/go.test/test/syntax/vareq1.go10
13 files changed, 174 insertions, 0 deletions
diff --git a/gcc/testsuite/go.test/test/syntax/forvar.go b/gcc/testsuite/go.test/test/syntax/forvar.go
new file mode 100644
index 000000000..f12ce55ca
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/forvar.go
@@ -0,0 +1,10 @@
+// errchk $G -e $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() {
+ for var x = 0; x < 10; x++ { // ERROR "var declaration not allowed in for initializer"
diff --git a/gcc/testsuite/go.test/test/syntax/import.go b/gcc/testsuite/go.test/test/syntax/import.go
new file mode 100644
index 000000000..dd1f26134
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/import.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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
+
+import (
+ "io", // ERROR "unexpected comma"
+ "os"
+)
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/interface.go b/gcc/testsuite/go.test/test/syntax/interface.go
new file mode 100644
index 000000000..a7f43533a
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/interface.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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
+
+type T interface {
+ f, g () // ERROR "name list not allowed in interface type"
+}
+
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi1.go b/gcc/testsuite/go.test/test/syntax/semi1.go
new file mode 100644
index 000000000..547d9bf79
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi1.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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() {
+ if x; y // ERROR "unexpected semicolon or newline before .?{.?|undefined"
+ {
+ z // GCCGO_ERROR "undefined"
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi2.go b/gcc/testsuite/go.test/test/syntax/semi2.go
new file mode 100644
index 000000000..28d1d3906
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi2.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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() {
+ switch x; y // ERROR "unexpected semicolon or newline before .?{.?|undefined"
+ {
+ z
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi3.go b/gcc/testsuite/go.test/test/syntax/semi3.go
new file mode 100644
index 000000000..ab5941bda
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi3.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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() {
+ for x; y; z // ERROR "unexpected semicolon or newline before .?{.?|undefined"
+ {
+ z // GCCGO_ERROR "undefined"
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi4.go b/gcc/testsuite/go.test/test/syntax/semi4.go
new file mode 100644
index 000000000..7a9c2956e
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi4.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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() {
+ for x // GCCGO_ERROR "undefined"
+ { // ERROR "unexpected semicolon or newline before .?{.?"
+ z // GCCGO_ERROR "undefined"
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi5.go b/gcc/testsuite/go.test/test/syntax/semi5.go
new file mode 100644
index 000000000..5f8ccc688
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi5.go
@@ -0,0 +1,13 @@
+// errchk $G -e $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()
+{ // ERROR "unexpected semicolon or newline before .?{.?"
+
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi6.go b/gcc/testsuite/go.test/test/syntax/semi6.go
new file mode 100644
index 000000000..b6279ed30
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi6.go
@@ -0,0 +1,13 @@
+// errchk $G -e $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
+
+type T // ERROR "unexpected semicolon or newline in type declaration"
+{
+
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/semi7.go b/gcc/testsuite/go.test/test/syntax/semi7.go
new file mode 100644
index 000000000..5a7b3ff4c
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/semi7.go
@@ -0,0 +1,14 @@
+// errchk $G -e $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() {
+ if x { } // GCCGO_ERROR "undefined"
+ else { } // ERROR "unexpected semicolon or newline before .?else.?"
+}
+
+
diff --git a/gcc/testsuite/go.test/test/syntax/topexpr.go b/gcc/testsuite/go.test/test/syntax/topexpr.go
new file mode 100644
index 000000000..93d86fbe9
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/topexpr.go
@@ -0,0 +1,20 @@
+// errchk $G -e $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
+
+fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration"
+
+func main() {
+}
+
+x++ // ERROR "non-declaration statement outside function body|expected declaration"
+
+func init() {
+}
+
+x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"
+
diff --git a/gcc/testsuite/go.test/test/syntax/vareq.go b/gcc/testsuite/go.test/test/syntax/vareq.go
new file mode 100644
index 000000000..8525be8cf
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/vareq.go
@@ -0,0 +1,10 @@
+// errchk $G -e $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() {
+ var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or '}' or newline"
diff --git a/gcc/testsuite/go.test/test/syntax/vareq1.go b/gcc/testsuite/go.test/test/syntax/vareq1.go
new file mode 100644
index 000000000..9d70bea39
--- /dev/null
+++ b/gcc/testsuite/go.test/test/syntax/vareq1.go
@@ -0,0 +1,10 @@
+// errchk $G -e $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
+
+var x map[string]string{"a":"b"} // ERROR "unexpected { at end of statement|expected ';' or newline after top level declaration"
+