New testcase for the deadreturnvalue deletion extension to -deadargelim

llvm-svn: 9389
This commit is contained in:
Chris Lattner 2003-10-22 22:33:59 +00:00
parent f140b28c16
commit b7c3faabcd
2 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,19 @@
; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEAD
implementation
internal int %test(int %DEADARG) { ; Dead arg only used by dead retval
ret int %DEADARG
}
int %test2(int %A) {
%DEAD = call int %test(int %A)
ret int 123
}
int %test3() {
%X = call int %test2(int 3232)
%Y = add int %X, -123
ret int %Y
}

View File

@ -0,0 +1,36 @@
; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis | not grep DEAD
%P = external global int
implementation
internal int %test(int %DEADARG) { ; Dead arg only used by dead retval
ret int %DEADARG
}
internal int %test2(int %DEADARG) {
%DEADRETVAL = call int %test(int %DEADARG)
ret int %DEADRETVAL
}
void %test3(int %X) {
%DEADRETVAL = call int %test2(int %X)
ret void
}
internal int %foo() {
%DEAD = load int* %P
ret int %DEAD
}
internal int %id(int %X) {
ret int %X
}
void %test4() {
%DEAD = call int %foo()
%DEAD2 = call int %id(int %DEAD)
ret void
}