llvm.org GIT mirror llvm / a2eec61
temporarily revert this testcase since its patch was reverted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52441 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 11 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis > %t
1 ;; Check that the 21 constants got propagated properly
2 ; RUN: cat %t | grep {%M = add i32 21, 21}
3 ;; Check that the second return values didn't get propagated
4 ; RUN: cat %t | grep {%N = add i32 %B, %D}
0 ; RUN: llvm-as < %s | opt -ipconstprop | llvm-dis | grep {add i32 21, 21}
51
6 define internal {i32, i32} @foo(i1 %Q) {
7 br i1 %Q, label %T, label %F
2 define internal {i32, i32} @foo(i1 %C) {
3 br i1 %C, label %T, label %F
84
95 T: ; preds = %0
10 ret i32 21, i32 22
6 ret i32 21, i32 21
117
128 F: ; preds = %0
13 ret i32 21, i32 23
9 ret i32 21, i32 21
1410 }
1511
16 define internal {i32, i32} @bar(i1 %Q) {
17 %A = insertvalue { i32, i32 } undef, i32 21, 0
18 br i1 %Q, label %T, label %F
19
20 T: ; preds = %0
21 %B = insertvalue { i32, i32 } %A, i32 22, 1
22 ret { i32, i32 } %B
23
24 F: ; preds = %0
25 %C = insertvalue { i32, i32 } %A, i32 23, 1
26 ret { i32, i32 } %C
12 define i32 @caller(i1 %C) {
13 %X = call {i32, i32} @foo( i1 %C )
14 %A = getresult {i32, i32} %X, 0
15 %B = getresult {i32, i32} %X, 1
16 %Y = add i32 %A, %B
17 ret i32 %Y
2718 }
2819
29 define { i32, i32 } @caller(i1 %Q) {
30 %X = call {i32, i32} @foo( i1 %Q )
31 %A = getresult {i32, i32} %X, 0
32 %B = getresult {i32, i32} %X, 1
33 %Y = call {i32, i32} @bar( i1 %Q )
34 %C = extractvalue {i32, i32} %Y, 0
35 %D = extractvalue {i32, i32} %Y, 1
36 %M = add i32 %A, %C
37 %N = add i32 %B, %D
38 ret { i32, i32 } %X
39 }
40