diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-05-12 17:59:55 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-05-12 17:59:55 +0000 |
commit | 45d6764ca1161420773693d21e9581f847e2cdda (patch) | |
tree | 6b1e732384ae3e7fb68947c15a38afe142d76c3f /test/ExecutionEngine | |
parent | 5156f5b214bafc24e20ed49114b35ffbd55dc623 (diff) | |
download | external_llvm-45d6764ca1161420773693d21e9581f847e2cdda.zip external_llvm-45d6764ca1161420773693d21e9581f847e2cdda.tar.gz external_llvm-45d6764ca1161420773693d21e9581f847e2cdda.tar.bz2 |
Add a test case for shl of APInt integers > 64 bits by 0 shift amount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine')
-rw-r--r-- | test/ExecutionEngine/2007-05-12-APInt-Shl.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ExecutionEngine/2007-05-12-APInt-Shl.ll b/test/ExecutionEngine/2007-05-12-APInt-Shl.ll new file mode 100644 index 0000000..cbea407 --- /dev/null +++ b/test/ExecutionEngine/2007-05-12-APInt-Shl.ll @@ -0,0 +1,30 @@ +; RUN: llvm-as %s -f -o %t.bc +; RUN: lli -force-interpreter=true %t.bc | tee %t.out | grep 10 + +; Test that APInt shift left works when bitwidth > 64 and shiftamt == 0 + +declare i32 @putchar(i32) + +define void @putBit(i65 %x, i65 %bitnum) { + %tmp1 = shl i65 1, %bitnum + %tmp2 = and i65 %x, %tmp1 + %cond = icmp ne i65 %tmp2, 0 + br i1 %cond, label %cond_true, label %cond_false + +cond_true: + call i32 @putchar(i32 49) + br label %cond_next + +cond_false: + call i32 @putchar(i32 48) + br label %cond_next + +cond_next: + ret void +} + +define i32 @main() { + call void @putBit(i65 1, i65 0) + call void @putBit(i65 0, i65 0) + ret i32 0 +} |