This commit is contained in:
dcodeIO
2017-12-02 20:58:39 +01:00
parent b9edfb5185
commit 9e053f311e
7 changed files with 226 additions and 9 deletions

35
tests/compiler/switch.ts Normal file
View File

@ -0,0 +1,35 @@
export function doSwitch(n: i32): i32 {
switch (n) {
case 1:
return 1;
case 0:
default:
return 0;
case 2:
case 3:
return 23;
}
}
export function doSwitchDefaultFirst(n: i32): i32 {
switch (n) {
default:
return 0;
case 1:
return 1;
case 2:
case 3:
return 23;
}
}
export function doSwitchDefaultOmitted(n: i32): i32 {
switch (n) {
case 1:
return 1;
case 2:
case 3:
return 23;
}
return 0;
}