diff options
Diffstat (limited to 'test/CodeGen/switch.c')
-rw-r--r-- | test/CodeGen/switch.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/switch.c b/test/CodeGen/switch.c new file mode 100644 index 0000000000..690c11e9f3 --- /dev/null +++ b/test/CodeGen/switch.c @@ -0,0 +1,17 @@ +// RUN: clang %s -emit-llvm | llvm-as | opt -std-compile-opts -disable-output + +int foo(int i) { + int j = 0; + switch (i) { + case 1 : + j = 2; break; + case 2: + j = 3; break; + default: + j = 42; break; + } + j = j + 1; + return j; +} + + |