2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
|
2006-12-31 06:02:00 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'lshr i32' | wc -l | grep 2 &&
|
2006-12-02 04:23:10 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep ashr
|
2006-09-18 04:31:18 +00:00
|
|
|
|
2006-11-09 05:11:23 +00:00
|
|
|
int %test1(int %X, ubyte %A) {
|
2006-09-18 04:31:18 +00:00
|
|
|
%Y = shr int %X, ubyte %A ; can be logical shift.
|
|
|
|
%Z = and int %Y, 1
|
|
|
|
ret int %Z
|
|
|
|
}
|
2006-11-09 05:11:23 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|