Modernize testcases

llvm-svn: 5589
This commit is contained in:
Chris Lattner 2003-02-18 19:43:21 +00:00
parent c5fccf34ab
commit 2ae37b0229
2 changed files with 10 additions and 10 deletions

View File

@ -10,33 +10,33 @@
implementation
int "test1"(int %A)
int %test1(int %A)
begin
%B = add int %A, 0
ret int %B
end
int "test2"(int %A)
int %test2(int %A)
begin
%B = add int %A, 5
%C = add int %B, -5
ret int %C
end
int "test3"(int %A)
int %test3(int %A)
begin
%B = add int %A, 5
%C = sub int %B, 5 ;; This should get converted to an add
ret int %C
end
int "test4"(int %A, int %B) {
int %test4(int %A, int %B) {
%C = sub int 0, %A
%D = add int %B, %C ; D = B + -A = B - A
ret int %D
}
int "test5"(int %A, int %B) {
int %test5(int %A, int %B) {
%C = sub int 0, %A
%D = add int %C, %B ; D = -A + B = B - A
ret int %D

View File

@ -8,29 +8,29 @@
implementation
int "test1"(int %A) {
int %test1(int %A) {
%B = sub int %A, %A ; ISA constant 0
ret int %B
}
int "test2"(int %A) {
int %test2(int %A) {
%B = sub int %A, 0
ret int %B
}
int "test3"(int %A) {
int %test3(int %A) {
%B = sub int 0, %A ; B = -A
%C = sub int 0, %B ; C = -B = A
ret int %C
}
int "test4"(int %A, int %x) {
int %test4(int %A, int %x) {
%B = sub int 0, %A
%C = sub int %x, %B
ret int %C
}
int "test5"(int %A, int %Bok, int %Cok) {
int %test5(int %A, int %Bok, int %Cok) {
%D = sub int %Bok, %Cok
%E = sub int %A, %D
ret int %E