[llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/SwitchLowering.ll
Chris Lattner
sabre at nondot.org
Sun Oct 22 14:36:20 PDT 2006
Changes in directory llvm/test/Regression/CodeGen/Generic:
SwitchLowering.ll added (r1.1)
---
Log message:
new testcase for PR964: http://llvm.org/PR964
---
Diffs of the changes: (+27 -0)
SwitchLowering.ll | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+)
Index: llvm/test/Regression/CodeGen/Generic/SwitchLowering.ll
diff -c /dev/null llvm/test/Regression/CodeGen/Generic/SwitchLowering.ll:1.1
*** /dev/null Sun Oct 22 16:36:16 2006
--- llvm/test/Regression/CodeGen/Generic/SwitchLowering.ll Sun Oct 22 16:36:06 2006
***************
*** 0 ****
--- 1,27 ----
+ ; RUN: llvm-as < %s | llc -march=x86 | grep cmp | wc -l | grep 1
+ ; PR964
+
+ sbyte* %FindChar(sbyte* %CurPtr) {
+ entry:
+ br label %bb
+
+ bb: ; preds = %bb, %entry
+ %indvar = phi uint [ 0, %entry ], [ %indvar.next, %bb ] ; <uint> [#uses=3]
+ %CurPtr_addr.0.rec = cast uint %indvar to int ; <int> [#uses=1]
+ %CurPtr_addr.0 = getelementptr sbyte* %CurPtr, uint %indvar ; <sbyte*> [#uses=1]
+ %tmp = load sbyte* %CurPtr_addr.0 ; <sbyte> [#uses=2]
+ %tmp2.rec = add int %CurPtr_addr.0.rec, 1 ; <int> [#uses=1]
+ %tmp2 = getelementptr sbyte* %CurPtr, int %tmp2.rec ; <sbyte*> [#uses=1]
+ %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
+ switch sbyte %tmp, label %bb [
+ sbyte 0, label %bb7
+ sbyte 120, label %bb7
+ ]
+
+ bb7: ; preds = %bb, %bb
+ %tmp = cast sbyte %tmp to ubyte ; <ubyte> [#uses=1]
+ tail call void %foo( ubyte %tmp )
+ ret sbyte* %tmp2
+ }
+
+ declare void %foo(ubyte)
More information about the llvm-commits
mailing list