llvm.org GIT mirror llvm / de0dcc3
New testcase for the deadreturnvalue deletion extension to -deadargelim git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9389 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
2 changed file(s) with 55 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis | not grep DEAD
1
2 implementation
3
4 internal int %test(int %DEADARG) { ; Dead arg only used by dead retval
5 ret int %DEADARG
6 }
7
8 int %test2(int %A) {
9 %DEAD = call int %test(int %A)
10 ret int 123
11 }
12
13 int %test3() {
14 %X = call int %test2(int 3232)
15 %Y = add int %X, -123
16 ret int %Y
17 }
18
0 ; RUN: llvm-as < %s | opt -deadargelim -die | llvm-dis | not grep DEAD
1
2 %P = external global int
3
4 implementation
5
6
7 internal int %test(int %DEADARG) { ; Dead arg only used by dead retval
8 ret int %DEADARG
9 }
10
11 internal int %test2(int %DEADARG) {
12 %DEADRETVAL = call int %test(int %DEADARG)
13 ret int %DEADRETVAL
14 }
15
16 void %test3(int %X) {
17 %DEADRETVAL = call int %test2(int %X)
18 ret void
19 }
20
21 internal int %foo() {
22 %DEAD = load int* %P
23 ret int %DEAD
24 }
25
26 internal int %id(int %X) {
27 ret int %X
28 }
29
30 void %test4() {
31 %DEAD = call int %foo()
32 %DEAD2 = call int %id(int %DEAD)
33 ret void
34 }
35