diff options
Diffstat (limited to 'clang/test/CodeGen/switch.c')
-rw-r--r-- | clang/test/CodeGen/switch.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/CodeGen/switch.c b/clang/test/CodeGen/switch.c index 25602e93c37..68313c0741f 100644 --- a/clang/test/CodeGen/switch.c +++ b/clang/test/CodeGen/switch.c @@ -30,3 +30,35 @@ int foo2(int i) { } +int foo3(int i) { + int j = 0; + switch (i) { + default: + j = 42; break; + case 111: + j = 111; break; + case 0 ... 100: + j = 1; break; + case 222: + j = 222; break; + } + return j; +} + + +int foo4(int i) { + int j = 0; + switch (i) { + case 111: + j = 111; break; + case 0 ... 100: + j = 1; break; + case 222: + j = 222; break; + default: + j = 42; break; + case 501 ... 600: + j = 5; break; + } + return j; +} |