summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/phi.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/phi.ll')
-rw-r--r--test/Transforms/InstCombine/phi.ll16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/Transforms/InstCombine/phi.ll b/test/Transforms/InstCombine/phi.ll
index 6f0ef6b549..4efbb79d9d 100644
--- a/test/Transforms/InstCombine/phi.ll
+++ b/test/Transforms/InstCombine/phi.ll
@@ -1,7 +1,6 @@
; This test makes sure that these instructions are properly eliminated.
;
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep phi
-; END.
define i32 @test1(i32 %A, i1 %b) {
BB0:
@@ -98,4 +97,19 @@ Exit: ; preds = %Loop
ret i32 0
}
+define i32* @test8({ i32, i32 } *%A, i1 %b) {
+BB0:
+ %X = getelementptr { i32, i32 } *%A, i32 0, i32 1
+ br i1 %b, label %BB1, label %BB2
+
+BB1:
+ %Y = getelementptr { i32, i32 } *%A, i32 0, i32 1
+ br label %BB2
+
+BB2:
+ ;; Suck GEPs into phi
+ %B = phi i32* [ %X, %BB0 ], [ %Y, %BB1 ]
+ ret i32* %B
+}
+