blob: 8d70f53bb8df3dc5d4cdf30aaaa5a20eef335cc6 [file] [log] [blame]
Chris Lattner4d3c66b2003-06-16 12:05:38 +00001; RUN: if as < %s | opt -load ~/llvm/lib/Debug/libhello.so -deadargelim | dis | grep DEADARG
2; RUN: then exit 1
3; RUN: else exit 0
4; RUN: fi
5
6implementation
7
8; test - an obviously dead argument
9internal int %test(int %v, int %DEADARG1, int* %p) {
10 store int %v, int* %p
11 ret int %v
12}
13
14; hardertest - an argument which is only used by a call of a function with a
15; dead argument.
16internal int %hardertest(int %DEADARG2) {
17 %p = alloca int
18 %V = call int %test(int 5, int %DEADARG2, int* %p)
19 ret int %V
20}
21
22; evenhardertest - recursive dead argument...
23internal void %evenhardertest(int %DEADARG3) {
24 call void %evenhardertest(int %DEADARG3)
25 ret void
26}
27