mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
69ccadd753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
18 lines
547 B
LLVM
18 lines
547 B
LLVM
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output &&
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | grep 'lshr int' | wc -l | grep 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
|
|
}
|
|
|