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
This commit is contained in:
Chris Lattner 2009-11-02 18:27:22 +00:00
parent 2bbbbd6ac8
commit 0909796868
2 changed files with 26 additions and 21 deletions

View File

@ -1,21 +0,0 @@
; RUN: opt < %s -ipsccp -S > %t
; RUN: grep {ret i32 36} %t
; RUN: grep {%mrv = insertvalue %T undef, i32 18, 0} %t
; RUN: grep {%mrv1 = insertvalue %T %mrv, i32 17, 1} %t
; RUN: grep {ret %T %mrv1} %t
; XFAIL: *
%T = type {i32,i32}
define internal {i32, i32} @bar(i32 %A) {
%X = add i32 1, %A
ret i32 %X, i32 %A
}
define i32 @foo() {
%X = call {i32, i32} @bar(i32 17)
%Y = getresult {i32, i32} %X, 0
%Z = add i32 %Y, %Y
ret i32 %Z
}

View File

@ -149,3 +149,29 @@ define i64 @test6b() {
; CHECK: define i64 @test6b
; CHECK: ret i64 0
;;======================== test7
%T = type {i32,i32}
define internal {i32, i32} @test7a(i32 %A) {
%X = add i32 1, %A
%mrv0 = insertvalue %T undef, i32 %X, 0
%mrv1 = insertvalue %T %mrv0, i32 %A, 1
ret %T %mrv1
; CHECK: @test7a
; CHECK-NEXT: %mrv0 = insertvalue %T undef, i32 18, 0
; CHECK-NEXT: %mrv1 = insertvalue %T %mrv0, i32 17, 1
}
define i32 @test7b() {
%X = call {i32, i32} @test7a(i32 17)
%Y = extractvalue {i32, i32} %X, 0
%Z = add i32 %Y, %Y
ret i32 %Z
; CHECK: define i32 @test7b
; CHECK-NEXT: call %T @test7a(i32 17)
; CHECK-NEXT: ret i32 36
}