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