blob: 5f3817c6728dd485edcb5e04ef425e2c8366c86c [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -deadargelim -S | not grep DEAD
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00003; Dead arg only used by dead retval
4define internal i32 @test(i32 %DEADARG) {
5 ret i32 %DEADARG
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006}
7
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00008define i32 @test2(i32 %A) {
9 %DEAD = call i32 @test( i32 %A ) ; <i32> [#uses=0]
10 ret i32 123
Dan Gohmanf17a25c2007-07-18 16:29:46 +000011}
12
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000013define i32 @test3() {
14 %X = call i32 @test2( i32 3232 ) ; <i32> [#uses=1]
15 %Y = add i32 %X, -123 ; <i32> [#uses=1]
16 ret i32 %Y
Dan Gohmanf17a25c2007-07-18 16:29:46 +000017}
18