3 // Copyright 2011 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // Verify that erroneous labels are caught by the compiler.
8 // This set is caught by pass 2. That's why this file is label1.go.
18 continue // ERROR "continue is not in a loop$|continue statement not within for"
22 continue // ERROR "continue is not in a loop$|continue statement not within for"
46 continue L2
// ERROR "invalid continue label .*L2|continue is not in a loop$"
53 continue L2
// ERROR "invalid continue label .*L2"
64 continue L3
// ERROR "invalid continue label .*L3|continue is not in a loop$"
72 break L4
// ERROR "invalid break label .*L4"
75 continue L4
// ERROR "invalid continue label .*L4|continue is not in a loop$"
85 break L5
// ERROR "invalid break label .*L5"
88 continue L5
// ERROR "invalid continue label .*L5|continue is not in a loop$"
96 break L1
// ERROR "invalid break label .*L1"
99 continue L1
// ERROR "invalid continue label .*L1"
106 continue // ERROR "continue is not in a loop$|continue statement not within for"
108 continue on
// ERROR "continue label not defined: on|invalid continue label .*on"
111 break // ERROR "break is not in a loop, switch, or select|break statement not within for or switch or select"
113 break dance
// ERROR "break label not defined: dance|invalid break label .*dance"