1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:14:40 -07:00

test: match gccgo error messages for label.go and label1.go.

label.go:30:1: error: label ‘L6’ already defined
label.go:28:1: note: previous definition of ‘L6’ was here
label.go:23:1: error: label ‘L4’ defined and not used
label.go:52:2: error: label ‘defalt’ defined and not used
label.go:17:1: error: label ‘L2’ defined and not used
label.go:26:1: error: label ‘L5’ defined and not used
label.go:20:1: error: label ‘L3’ defined and not used
label.go:14:1: error: label ‘L1’ defined and not used

label1.go:32:13: error: invalid continue label ‘L2’
label1.go:44:13: error: invalid continue label ‘L3’
label1.go:52:10: error: invalid break label ‘L4’
label1.go:55:13: error: invalid continue label ‘L4’
label1.go:65:9: error: invalid break label ‘L5’
label1.go:68:12: error: invalid continue label ‘L5’
label1.go:76:10: error: invalid break label ‘L1’
label1.go:79:13: error: invalid continue label ‘L1’

R=rsc
CC=golang-dev
https://golang.org/cl/4275078
This commit is contained in:
Ian Lance Taylor 2011-03-25 10:36:46 -07:00
parent 7c616b3809
commit 8beb4be850
2 changed files with 16 additions and 16 deletions

View File

@ -11,23 +11,23 @@ package main
var x int var x int
func f() { func f() {
L1: // ERROR "label L1 defined and not used" L1: // ERROR "label .*L1.* defined and not used"
for { for {
} }
L2: // ERROR "label L2 defined and not used" L2: // ERROR "label .*L2.* defined and not used"
select { select {
} }
L3: // ERROR "label L3 defined and not used" L3: // ERROR "label .*L3.* defined and not used"
switch { switch {
} }
L4: // ERROR "label L4 defined and not used" L4: // ERROR "label .*L4.* defined and not used"
if true { if true {
} }
L5: // ERROR "label L5 defined and not used" L5: // ERROR "label .*L5.* defined and not used"
f() f()
L6: L6: // GCCGO_ERROR "previous"
f() f()
L6: // ERROR "label L6 already defined at" L6: // ERROR "label .*L6.* already defined"
f() f()
if x == 20 { if x == 20 {
goto L6 goto L6
@ -49,7 +49,7 @@ L9:
switch { switch {
case true: case true:
break L9 break L9
defalt: // ERROR "label defalt defined and not used" defalt: // ERROR "label .*defalt.* defined and not used"
} }
L10: L10:

View File

@ -29,7 +29,7 @@ L2:
break L2 break L2
} }
if x == 1 { if x == 1 {
continue L2 // ERROR "invalid continue label L2" continue L2 // ERROR "invalid continue label .*L2"
} }
goto L2 goto L2
} }
@ -41,7 +41,7 @@ L3:
break L3 break L3
} }
if x == 12 { if x == 12 {
continue L3 // ERROR "invalid continue label L3" continue L3 // ERROR "invalid continue label .*L3"
} }
goto L3 goto L3
} }
@ -49,10 +49,10 @@ L3:
L4: L4:
if true { if true {
if x == 13 { if x == 13 {
break L4 // ERROR "invalid break label L4" break L4 // ERROR "invalid break label .*L4"
} }
if x == 14 { if x == 14 {
continue L4 // ERROR "invalid continue label L4" continue L4 // ERROR "invalid continue label .*L4"
} }
if x == 15 { if x == 15 {
goto L4 goto L4
@ -62,10 +62,10 @@ L4:
L5: L5:
f() f()
if x == 16 { if x == 16 {
break L5 // ERROR "invalid break label L5" break L5 // ERROR "invalid break label .*L5"
} }
if x == 17 { if x == 17 {
continue L5 // ERROR "invalid continue label L5" continue L5 // ERROR "invalid continue label .*L5"
} }
if x == 18 { if x == 18 {
goto L5 goto L5
@ -73,10 +73,10 @@ L5:
for { for {
if x == 19 { if x == 19 {
break L1 // ERROR "invalid break label L1" break L1 // ERROR "invalid break label .*L1"
} }
if x == 20 { if x == 20 {
continue L1 // ERROR "invalid continue label L1" continue L1 // ERROR "invalid continue label .*L1"
} }
if x == 21 { if x == 21 {
goto L1 goto L1