aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-19 19:36:32 +0000
committerChris Lattner <sabre@nondot.org>2006-03-19 19:36:32 +0000
commit2c58d3ac82ea7c6762e935c1f975be3ada2aeaf0 (patch)
tree5cb83a9214ac878b0edbe8c0d5483e41829c70d7 /test/Transforms
parentc12e6c488e268c1659e364bce2fdd66fd4e20dd0 (diff)
downloadexternal_llvm-2c58d3ac82ea7c6762e935c1f975be3ada2aeaf0.zip
external_llvm-2c58d3ac82ea7c6762e935c1f975be3ada2aeaf0.tar.gz
external_llvm-2c58d3ac82ea7c6762e935c1f975be3ada2aeaf0.tar.bz2
new testcase, contributed by Eric Kidd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/CorrelatedExprs/switch.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/CorrelatedExprs/switch.ll b/test/Transforms/CorrelatedExprs/switch.ll
new file mode 100644
index 0000000..8bf8964
--- /dev/null
+++ b/test/Transforms/CorrelatedExprs/switch.ll
@@ -0,0 +1,20 @@
+; RUN: llvm-as < %s | opt -cee -constprop -instcombine -dce | llvm-dis | not grep 'REMOVE'
+
+int %test_case_values_should_propagate(int %A) {
+ switch int %A, label %D [
+ int 40, label %C1
+ int 41, label %C2
+ int 42, label %C3
+ ]
+C1:
+ %REMOVE1 = add int %A, 2 ; Should be 42.
+ ret int %REMOVE1
+C2:
+ %REMOVE2 = add int %A, 3 ; Should be 44.
+ ret int %REMOVE2
+C3:
+ %REMOVE3 = add int %A, 4 ; Should be 46.
+ ret int %REMOVE3
+D:
+ ret int 10
+}