[llvm-commits] CVS: llvm/test/ExecutionEngine/2007-05-12-APInt-Shl.ll

Reid Spencer reid at x10sys.com
Sat May 12 11:00:12 PDT 2007



Changes in directory llvm/test/ExecutionEngine:

2007-05-12-APInt-Shl.ll added (r1.1)
---
Log message:

Add a test case for shl of APInt integers > 64 bits by 0 shift amount.


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

 2007-05-12-APInt-Shl.ll |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+)


Index: llvm/test/ExecutionEngine/2007-05-12-APInt-Shl.ll
diff -c /dev/null llvm/test/ExecutionEngine/2007-05-12-APInt-Shl.ll:1.1
*** /dev/null	Sat May 12 13:00:05 2007
--- llvm/test/ExecutionEngine/2007-05-12-APInt-Shl.ll	Sat May 12 12:59:55 2007
***************
*** 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
+ }






More information about the llvm-commits mailing list