aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/switch.c
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-04 23:45:31 +0000
committerDevang Patel <dpatel@apple.com>2007-10-04 23:45:31 +0000
commit51b09f2c528c8460b5465c676173324e44176d62 (patch)
treec5b00fdf16c14e53e9610b654c3b366a0113a0f0 /test/CodeGen/switch.c
parentb384d329e0b727d4f2effa28fbb9aba2ac420e7b (diff)
switch statement code gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/switch.c')
-rw-r--r--test/CodeGen/switch.c17
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;
+}
+
+