summaryrefslogtreecommitdiff
path: root/test/Transforms/SCCP
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-20 21:04:26 +0000
committerChris Lattner <sabre@nondot.org>2009-10-20 21:04:26 +0000
commitd0d3cbb362ed87c7d689afe6439bf7789c36dac9 (patch)
treeb0211edcc686be929f2a03633ed5e1bfa77743f3 /test/Transforms/SCCP
parent82a39b3e14a20bc0ae00917b9ad785b93769df9e (diff)
downloadllvm-d0d3cbb362ed87c7d689afe6439bf7789c36dac9.tar.gz
llvm-d0d3cbb362ed87c7d689afe6439bf7789c36dac9.tar.bz2
llvm-d0d3cbb362ed87c7d689afe6439bf7789c36dac9.tar.xz
add a real testcase for PR4313
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SCCP')
-rw-r--r--test/Transforms/SCCP/ipsccp-basic.ll32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/Transforms/SCCP/ipsccp-basic.ll b/test/Transforms/SCCP/ipsccp-basic.ll
index 6141972c25..d3584d1b3c 100644
--- a/test/Transforms/SCCP/ipsccp-basic.ll
+++ b/test/Transforms/SCCP/ipsccp-basic.ll
@@ -102,3 +102,35 @@ define internal i64 @test4c(i64 %a) {
}
; CHECK: define internal i64 @test4c
; CHECK: ret i64 undef
+
+
+
+;;======================== test5
+
+; PR4313
+define internal {i64,i64} @test5a() {
+ %a = insertvalue {i64,i64} undef, i64 4, 1
+ %b = insertvalue {i64,i64} %a, i64 5, 0
+ ret {i64,i64} %b
+}
+
+define i64 @test5b() {
+ %a = invoke {i64,i64} @test5a()
+ to label %A unwind label %B
+A:
+ %c = call i64 @test5c({i64,i64} %a)
+ ret i64 %c
+B:
+ ret i64 0
+}
+
+; CHECK: define i64 @test5b()
+; CHECK: A:
+; CHECK-NEXT: %c = call i64 @test5c(%0 %a)
+; CHECK-NEXT: ret i64 %c
+
+define internal i64 @test5c({i64,i64} %a) {
+ %b = extractvalue {i64,i64} %a, 0
+ ret i64 %b
+}
+