1 ; RUN: opt < %s -ipconstprop -S > %t
2 ;; Check that the 21 constants got propagated properly
3 ; RUN: cat %t | grep {%M = add i32 21, 21}
4 ;; Check that the second return values didn't get propagated
5 ; RUN: cat %t | grep {%N = add i32 %B, %D}
7 define internal {i32, i32} @foo(i1 %Q) {
8 br i1 %Q, label %T, label %F
17 define internal {i32, i32} @bar(i1 %Q) {
18 %A = insertvalue { i32, i32 } undef, i32 21, 0
19 br i1 %Q, label %T, label %F
22 %B = insertvalue { i32, i32 } %A, i32 22, 1
26 %C = insertvalue { i32, i32 } %A, i32 23, 1
30 define { i32, i32 } @caller(i1 %Q) {
31 %X = call {i32, i32} @foo( i1 %Q )
32 %A = getresult {i32, i32} %X, 0
33 %B = getresult {i32, i32} %X, 1
34 %Y = call {i32, i32} @bar( i1 %Q )
35 %C = extractvalue {i32, i32} %Y, 0
36 %D = extractvalue {i32, i32} %Y, 1