blob: a3a4235400e942880db8512978d1a0d3acb8b4a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
; RUN: llvm-upgrade < %s | llvm-as | opt -deadargelim | llvm-dis | not grep DEADARG
implementation
; test - an obviously dead argument
internal int %test(int %v, int %DEADARG1, int* %p) {
store int %v, int* %p
ret int %v
}
; hardertest - an argument which is only used by a call of a function with a
; dead argument.
internal int %hardertest(int %DEADARG2) {
%p = alloca int
%V = call int %test(int 5, int %DEADARG2, int* %p)
ret int %V
}
; evenhardertest - recursive dead argument...
internal void %evenhardertest(int %DEADARG3) {
call void %evenhardertest(int %DEADARG3)
ret void
}
internal void %needarg(int %TEST) {
call int %needarg2(int %TEST)
ret void
}
internal int %needarg2(int %TEST) {
ret int %TEST
}
internal void %needarg3(int %TEST3) {
call void %needarg(int %TEST3)
ret void
}
|