Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / go.test / test / declbad.go
index 09f1dfb..ff53ab0 100644 (file)
@@ -1,10 +1,11 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // 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.
 
-// Incorrect short declarations and redeclarations.
+// Test that incorrect short declarations and redeclarations are detected.
+// Does not compile.
 
 package main
 
@@ -38,6 +39,13 @@ func main() {
                _, _, _ = i, f, s
        }
        {
+               // multiline no new variables
+               i := f1
+               i := func() { // ERROR "redeclared|no new|incompatible"
+               }
+               _ = i
+       }
+       {
                // single redeclaration
                i, f, s := f3()
                i := 1 // ERROR "redeclared|no new|incompatible"