diff options
Diffstat (limited to 'gcc/testsuite/go.test/test/declbad.go')
-rw-r--r-- | gcc/testsuite/go.test/test/declbad.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/testsuite/go.test/test/declbad.go b/gcc/testsuite/go.test/test/declbad.go index 09f1dfb576..728eceb7f1 100644 --- a/gcc/testsuite/go.test/test/declbad.go +++ b/gcc/testsuite/go.test/test/declbad.go @@ -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,14 @@ func main() { _, _, _ = i, f, s } { + // multiline no new variables + i := f1 + i := func() int { // ERROR "redeclared|no new|incompatible" + return 0 + } + _ = i + } + { // single redeclaration i, f, s := f3() i := 1 // ERROR "redeclared|no new|incompatible" |