mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47793 91177308-0d34-0410-b5e6-96231b3b80d8
34 lines
867 B
LLVM
34 lines
867 B
LLVM
; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis | not grep DEAD
|
|
|
|
@P = external global i32 ; <i32*> [#uses=1]
|
|
|
|
; Dead arg only used by dead retval
|
|
define internal i32 @test(i32 %DEADARG) {
|
|
ret i32 %DEADARG
|
|
}
|
|
|
|
define internal i32 @test2(i32 %DEADARG) {
|
|
%DEADRETVAL = call i32 @test( i32 %DEADARG ) ; <i32> [#uses=1]
|
|
ret i32 %DEADRETVAL
|
|
}
|
|
|
|
define void @test3(i32 %X) {
|
|
%DEADRETVAL = call i32 @test2( i32 %X ) ; <i32> [#uses=0]
|
|
ret void
|
|
}
|
|
|
|
define internal i32 @foo() {
|
|
%DEAD = load i32* @P ; <i32> [#uses=1]
|
|
ret i32 %DEAD
|
|
}
|
|
|
|
define internal i32 @id(i32 %X) {
|
|
ret i32 %X
|
|
}
|
|
|
|
define void @test4() {
|
|
%DEAD = call i32 @foo( ) ; <i32> [#uses=1]
|
|
%DEAD2 = call i32 @id( i32 %DEAD ) ; <i32> [#uses=0]
|
|
ret void
|
|
}
|