aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/v/checker/tests/labelled_break_continue.vv
blob: 3447ab155cf7b4cfb348a2c5485afabc08304040 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
fn main() {
	mut i := 4
	// check branching to a later loop
	L1: for {
		i++
		for {
			if i < 7 {continue L2}
			else {break L2}
		}
	}
	// check branching to an earlier loop
	L2: for e in [1,2,3,4] {
		i = e
		for {
			if i < 3 {continue L1}
			else {break L1}
		}
	}
	// check nested loops (not supported ATM)
	L3: for ;; i++ {
		L4: for {
			if i < 17 {continue L3}
			else {break L3}
		}
	}
}