diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/fixedbugs/bug136.go (renamed from test/bugs/bug136.go) | 0 | ||||
| -rw-r--r-- | test/fixedbugs/bug178.go | 27 | ||||
| -rw-r--r-- | test/fixedbugs/bug179.go | 24 | ||||
| -rw-r--r-- | test/golden.out | 6 |
4 files changed, 54 insertions, 3 deletions
diff --git a/test/bugs/bug136.go b/test/fixedbugs/bug136.go index 5846c654b..5846c654b 100644 --- a/test/bugs/bug136.go +++ b/test/fixedbugs/bug136.go diff --git a/test/fixedbugs/bug178.go b/test/fixedbugs/bug178.go new file mode 100644 index 000000000..4f586342b --- /dev/null +++ b/test/fixedbugs/bug178.go @@ -0,0 +1,27 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// 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. + +package main + +func main() { +L: + for i := 0; i < 1; i++ { +L1: + for { + break L; + } + panic("BUG: not reached - break"); + } + +L2: + for i := 0; i < 1; i++ { +L3: + for { + continue L2; + } + panic("BUG: not reached - continue"); + } +} diff --git a/test/fixedbugs/bug179.go b/test/fixedbugs/bug179.go new file mode 100644 index 000000000..690b01265 --- /dev/null +++ b/test/fixedbugs/bug179.go @@ -0,0 +1,24 @@ +// errchk $G -e $D/$F.go + +// 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. + +package main + +func main() { +L: + for { + for { + break L2; // ERROR "L2" + continue L2; // ERROR "L2" + } + } + +L1: + x := 1; + for { + break L1; // ERROR "L1" + continue L1; // ERROR "L1" + } +} diff --git a/test/golden.out b/test/golden.out index be5f7482b..a92efaffe 100644 --- a/test/golden.out +++ b/test/golden.out @@ -88,9 +88,6 @@ panic PC=xxx =========== bugs/bug132.go BUG: compilation succeeds incorrectly -=========== bugs/bug136.go -BUG: should not compile - =========== bugs/bug159.go abc: expected 4 5 6 got 4 4 -4 BUG: bug159 @@ -227,6 +224,9 @@ fixedbugs/bug133.dir/bug2.go:11: undefined: bug0.T field i fixedbugs/bug133.dir/bug2.go:11: illegal types for operand: RETURN int +=========== fixedbugs/bug136.go +fixedbugs/bug136.go:9: invalid break label L + =========== fixedbugs/bug148.go 2 3 interface is main.T, not main.T·bug148·1 |
