aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/switch_case_own_block.zc
blob: 63bdc5f76f2cde4402eb8a85d7cd7fa5f99da03a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
// expect: 5/6/
// spec 4.7.2: the statements of a case form their own block
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
void t(int k) {
	switch (k) {
	case 1: int x = 5; pn(x);
	case 2: int x = 6; pn(x);
	}
}
fn main() { t(1); t(2); return 0; }
// zc0: skip