aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/4-statements/switch_case_underscore.zc
blob: 969ea7ebd1cbb19a75ba091776c3168ea9181b42 (plain) (blame)
1
2
3
4
5
6
7
8
// expect: d/one/
// spec 4.7.1: case _ is a catch-all with the same meaning as default
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
void ps(char* s) { rt.put_s(s); rt.put_c(10); }
void t(int k) { switch (k) { case 1: ps("one"); case _: ps("d"); } }
fn main() { t(8); t(1); return 0; }
// zc0: skip