summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll')
-rw-r--r--llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll b/llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll
new file mode 100644
index 00000000000..7cd38c2f0c6
--- /dev/null
+++ b/llvm/test/Transforms/Mem2Reg/2003-04-24-MultipleIdenticalSuccessors.ll
@@ -0,0 +1,15 @@
+; Mem2reg used to only add one incoming value to a PHI node, even if it had
+; multiple incoming edges from a block.
+;
+; RUN: llvm-upgrade < %s | llvm-as | opt -mem2reg -disable-output
+
+int %test(bool %c1, bool %c2) {
+ %X = alloca int
+ br bool %c1, label %Exit, label %B2
+B2:
+ store int 2, int* %X
+ br bool %c2, label %Exit, label %Exit
+Exit:
+ %Y = load int *%X
+ ret int %Y
+}
OpenPOWER on IntegriCloud