aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/switch_break_in_loop_leaves_switch_only.zc
blob: ab55e4d7daf6229720959bf0ce2375b83f77e696 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// expect: 5/
// spec 4.7.1: break in a switch inside a loop leaves the switch, not the loop
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() {
	int n = 0;
	for (int i = 0; i < 3; i++) {
		switch (i) { case 1: break; default: n++; }
		n++;
	}
	pn(n);
	return 0;
}
// zc0: skip