diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-22 21:36:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-22 21:36:06 +0000 |
commit | 96f5362ff29bb91baf48caed92637c7bb2ffd8d1 (patch) | |
tree | 4e38885ad72a6af52f1b4c039ae2524e36342573 /test | |
parent | 802fe27d3e61646fafa74332756c2fcd8f243fac (diff) | |
download | external_llvm-96f5362ff29bb91baf48caed92637c7bb2ffd8d1.zip external_llvm-96f5362ff29bb91baf48caed92637c7bb2ffd8d1.tar.gz external_llvm-96f5362ff29bb91baf48caed92637c7bb2ffd8d1.tar.bz2 |
new testcase for PR964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/Generic/SwitchLowering.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeGen/Generic/SwitchLowering.ll b/test/CodeGen/Generic/SwitchLowering.ll new file mode 100644 index 0000000..136bdb4 --- /dev/null +++ b/test/CodeGen/Generic/SwitchLowering.ll @@ -0,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) |