2008-03-01 09:15:35 +00:00
|
|
|
; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEADARG
|
2003-06-16 12:05:38 +00:00
|
|
|
|
|
|
|
; test - an obviously dead argument
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal i32 @test(i32 %v, i32 %DEADARG1, i32* %p) {
|
|
|
|
store i32 %v, i32* %p
|
|
|
|
ret i32 %v
|
2003-06-16 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; hardertest - an argument which is only used by a call of a function with a
|
|
|
|
; dead argument.
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal i32 @hardertest(i32 %DEADARG2) {
|
|
|
|
%p = alloca i32 ; <i32*> [#uses=1]
|
|
|
|
%V = call i32 @test( i32 5, i32 %DEADARG2, i32* %p ) ; <i32> [#uses=1]
|
|
|
|
ret i32 %V
|
2003-06-16 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
; evenhardertest - recursive dead argument...
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal void @evenhardertest(i32 %DEADARG3) {
|
|
|
|
call void @evenhardertest( i32 %DEADARG3 )
|
|
|
|
ret void
|
2003-06-16 12:05:38 +00:00
|
|
|
}
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal void @needarg(i32 %TEST) {
|
|
|
|
call i32 @needarg2( i32 %TEST ) ; <i32>:1 [#uses=0]
|
|
|
|
ret void
|
2003-06-17 22:21:55 +00:00
|
|
|
}
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal i32 @needarg2(i32 %TEST) {
|
|
|
|
ret i32 %TEST
|
2003-06-17 22:21:55 +00:00
|
|
|
}
|
|
|
|
|
2008-03-01 09:15:35 +00:00
|
|
|
define internal void @needarg3(i32 %TEST3) {
|
|
|
|
call void @needarg( i32 %TEST3 )
|
|
|
|
ret void
|
2003-06-17 22:21:55 +00:00
|
|
|
}
|
2008-03-01 09:15:35 +00:00
|
|
|
|