1e76ecbb0SBjorn Pettersson; RUN: opt < %s -passes=deadargelim -S | not grep DEADARG 2cee313d2SEric Christopher 3cee313d2SEric Christopher; test - an obviously dead argument 4*055fb779SNikita Popovdefine internal i32 @test(i32 %v, i32 %DEADARG1, ptr %p) { 5*055fb779SNikita Popov store i32 %v, ptr %p 6cee313d2SEric Christopher ret i32 %v 7cee313d2SEric Christopher} 8cee313d2SEric Christopher 9cee313d2SEric Christopher; hardertest - an argument which is only used by a call of a function with a 10cee313d2SEric Christopher; dead argument. 11cee313d2SEric Christopherdefine internal i32 @hardertest(i32 %DEADARG2) { 12*055fb779SNikita Popov %p = alloca i32 ; <ptr> [#uses=1] 13*055fb779SNikita Popov %V = call i32 @test( i32 5, i32 %DEADARG2, ptr %p ) ; <i32> [#uses=1] 14cee313d2SEric Christopher ret i32 %V 15cee313d2SEric Christopher} 16cee313d2SEric Christopher 17cee313d2SEric Christopher; evenhardertest - recursive dead argument... 18cee313d2SEric Christopherdefine internal void @evenhardertest(i32 %DEADARG3) { 19cee313d2SEric Christopher call void @evenhardertest( i32 %DEADARG3 ) 20cee313d2SEric Christopher ret void 21cee313d2SEric Christopher} 22cee313d2SEric Christopher 23cee313d2SEric Christopherdefine internal void @needarg(i32 %TEST) { 24cee313d2SEric Christopher call i32 @needarg2( i32 %TEST ) ; <i32>:1 [#uses=0] 25cee313d2SEric Christopher ret void 26cee313d2SEric Christopher} 27cee313d2SEric Christopher 28cee313d2SEric Christopherdefine internal i32 @needarg2(i32 %TEST) { 29cee313d2SEric Christopher ret i32 %TEST 30cee313d2SEric Christopher} 31cee313d2SEric Christopher 32cee313d2SEric Christopherdefine internal void @needarg3(i32 %TEST3) { 33cee313d2SEric Christopher call void @needarg( i32 %TEST3 ) 34cee313d2SEric Christopher ret void 35cee313d2SEric Christopher} 36cee313d2SEric Christopher 37