mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-12 14:20:33 +00:00
More testcases I don't want to forget about
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2480 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
33a90b18e0
commit
829b79dd8c
@ -28,4 +28,13 @@ bool "test4"(bool %A) {
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
int "test5"(int %A) {
|
||||
%B = and int %A, %A
|
||||
ret int %B
|
||||
}
|
||||
|
||||
bool "test6"(bool %A) {
|
||||
%B = and bool %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,30 @@ bool "test5"(bool %A) {
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
int "test5"(int %A) {
|
||||
int "test6"(int %A) {
|
||||
%B = xor int %A, 0
|
||||
ret int %B
|
||||
}
|
||||
|
||||
bool "test7"(bool %A) {
|
||||
%B = xor bool %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
int "test8"(int %A) {
|
||||
%B = xor int %A, %A
|
||||
ret int %B
|
||||
}
|
||||
|
||||
bool "test9"(bool %A) {
|
||||
%B = or bool %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
int "test10"(int %A) {
|
||||
%B = or int %A, %A
|
||||
ret int %B
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
39
test/Transforms/InstCombine/set.ll
Normal file
39
test/Transforms/InstCombine/set.ll
Normal file
@ -0,0 +1,39 @@
|
||||
; This test makes sure that these instructions are properly eliminated.
|
||||
;
|
||||
|
||||
; RUN: if as < %s | opt -instcombine -dce | dis | grep set
|
||||
; RUN: then exit 1
|
||||
; RUN: else exit 0
|
||||
; RUN: fi
|
||||
|
||||
implementation
|
||||
|
||||
bool "test1"(int %A) {
|
||||
%B = seteq int %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
bool "test2"(int %A) {
|
||||
%B = setne int %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
bool "test3"(int %A) {
|
||||
%B = setlt int %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
bool "test4"(int %A) {
|
||||
%B = setgt int %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
bool "test5"(int %A) {
|
||||
%B = setle int %A, %A
|
||||
ret bool %B
|
||||
}
|
||||
|
||||
bool "test6"(int %A) {
|
||||
%B = setge int %A, %A
|
||||
ret bool %B
|
||||
}
|
21
test/Transforms/InstCombine/sub.ll
Normal file
21
test/Transforms/InstCombine/sub.ll
Normal file
@ -0,0 +1,21 @@
|
||||
; This test makes sure that these instructions are properly eliminated.
|
||||
;
|
||||
|
||||
; RUN: if as < %s | opt -instcombine -dce | dis | grep sub
|
||||
; RUN: then exit 1
|
||||
; RUN: else exit 0
|
||||
; RUN: fi
|
||||
|
||||
implementation
|
||||
|
||||
int "test1"(int %A) {
|
||||
%B = sub int %A, %A ; ISA constant 0
|
||||
ret int %B
|
||||
}
|
||||
|
||||
int "test2"(int %A) {
|
||||
%B = sub int %A, 0
|
||||
ret int %B
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user