mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-17 03:07:06 +00:00
6d0996866c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12543 91177308-0d34-0410-b5e6-96231b3b80d8
38 lines
710 B
LLVM
38 lines
710 B
LLVM
; This test makes sure that these instructions are properly eliminated.
|
|
;
|
|
|
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep select
|
|
|
|
implementation
|
|
|
|
int %test1(int %A, int %B) {
|
|
%C = select bool false, int %A, int %B
|
|
ret int %C
|
|
}
|
|
|
|
int %test2(int %A, int %B) {
|
|
%C = select bool true, int %A, int %B
|
|
ret int %C
|
|
}
|
|
|
|
int %test3(bool %C, int %I) {
|
|
%V = select bool %C, int %I, int %I ; V = I
|
|
ret int %V
|
|
}
|
|
|
|
bool %test4(bool %C) {
|
|
%V = select bool %C, bool true, bool false ; V = C
|
|
ret bool %V
|
|
}
|
|
|
|
bool %test5(bool %C) {
|
|
%V = select bool %C, bool false, bool true ; V = !C
|
|
ret bool %V
|
|
}
|
|
|
|
int %test6(bool %C) {
|
|
%V = select bool %C, int 1, int 0 ; V = cast C to int
|
|
ret int %V
|
|
}
|
|
|