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