llvm.org GIT mirror llvm / 0909796
merge 2008-03-10-sret.ll into ipsccp-basic.ll, and upgrade its syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85811 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 9 years ago
2 changed file(s) with 26 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
+0
-21
test/Transforms/SCCP/2008-03-10-sret.ll less more
None ; RUN: opt < %s -ipsccp -S > %t
1 ; RUN: grep {ret i32 36} %t
2 ; RUN: grep {%mrv = insertvalue %T undef, i32 18, 0} %t
3 ; RUN: grep {%mrv1 = insertvalue %T %mrv, i32 17, 1} %t
4 ; RUN: grep {ret %T %mrv1} %t
5
6 ; XFAIL: *
7
8 %T = type {i32,i32}
9
10 define internal {i32, i32} @bar(i32 %A) {
11 %X = add i32 1, %A
12 ret i32 %X, i32 %A
13 }
14
15 define i32 @foo() {
16 %X = call {i32, i32} @bar(i32 17)
17 %Y = getresult {i32, i32} %X, 0
18 %Z = add i32 %Y, %Y
19 ret i32 %Z
20 }
148148 ; CHECK: define i64 @test6b
149149 ; CHECK: ret i64 0
150150
151 ;;======================== test7
152
153
154 %T = type {i32,i32}
155
156 define internal {i32, i32} @test7a(i32 %A) {
157 %X = add i32 1, %A
158 %mrv0 = insertvalue %T undef, i32 %X, 0
159 %mrv1 = insertvalue %T %mrv0, i32 %A, 1
160 ret %T %mrv1
161 ; CHECK: @test7a
162 ; CHECK-NEXT: %mrv0 = insertvalue %T undef, i32 18, 0
163 ; CHECK-NEXT: %mrv1 = insertvalue %T %mrv0, i32 17, 1
164 }
165
166 define i32 @test7b() {
167 %X = call {i32, i32} @test7a(i32 17)
168 %Y = extractvalue {i32, i32} %X, 0
169 %Z = add i32 %Y, %Y
170 ret i32 %Z
171 ; CHECK: define i32 @test7b
172 ; CHECK-NEXT: call %T @test7a(i32 17)
173 ; CHECK-NEXT: ret i32 36
174 }
175
176