1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-01 16:33:37 +01:00
llvm-mirror/test/Transforms/InstCombine/shift-sra.ll
2007-08-15 13:36:28 +00:00

18 lines
476 B
LLVM

; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
; RUN: grep {lshr i32} | count 2
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ashr
int %test1(int %X, ubyte %A) {
%Y = shr int %X, ubyte %A ; can be logical shift.
%Z = and int %Y, 1
ret int %Z
}
int %test2(ubyte %tmp) {
%tmp3 = cast ubyte %tmp to int
%tmp4 = add int %tmp3, 7
%tmp5 = ashr int %tmp4, ubyte 3 ; lshr
ret int %tmp5
}