mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
de0dcc3593
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9389 91177308-0d34-0410-b5e6-96231b3b80d8
37 lines
587 B
LLVM
37 lines
587 B
LLVM
; 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
|
|
}
|
|
|