merge 2008-03-10-sret.ll into ipsccp-basic.ll, and upgrade its syntax.

llvm-svn: 85811
This commit is contained in:
Chris Lattner 2009-11-02 18:27:22 +00:00
parent a1776913ab
commit fc4e63b285
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
}