[llvm-commits] CVS: llvm/test/Regression/Transforms/CorrelatedExprs/switch.ll

Chris Lattner lattner at cs.uiuc.edu
Sun Mar 19 11:36:55 PST 2006



Changes in directory llvm/test/Regression/Transforms/CorrelatedExprs:

switch.ll added (r1.1)
---
Log message:

new testcase, contributed by Eric Kidd.


---
Diffs of the changes:  (+20 -0)

 switch.ll |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+)


Index: llvm/test/Regression/Transforms/CorrelatedExprs/switch.ll
diff -c /dev/null llvm/test/Regression/Transforms/CorrelatedExprs/switch.ll:1.1
*** /dev/null	Sun Mar 19 13:36:42 2006
--- llvm/test/Regression/Transforms/CorrelatedExprs/switch.ll	Sun Mar 19 13:36:32 2006
***************
*** 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
+ }






More information about the llvm-commits mailing list