mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37009 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
631 B
LLVM
31 lines
631 B
LLVM
; 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
|
|
}
|