OSDN Git Service

Make sure that LCSSA works properly when it encounters an exit block that has
authorOwen Anderson <resistor@mac.com>
Mon, 12 Jun 2006 07:05:47 +0000 (07:05 +0000)
committerOwen Anderson <resistor@mac.com>
Mon, 12 Jun 2006 07:05:47 +0000 (07:05 +0000)
more than one predecessor inside the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28749 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll [new file with mode: 0644]

diff --git a/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll b/test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll
new file mode 100644 (file)
index 0000000..83a0f9f
--- /dev/null
@@ -0,0 +1,28 @@
+; RUN: llvm-as < %s | opt -lcssa | llvm-dis | grep "%X.1.lcssa" &&
+; RUN: llvm-as < %s | opt -lcssa | llvm-dis | not grep "%X.1.lcssa1"
+
+declare bool %c1()
+declare bool %c2()
+
+int %foo() {
+entry:
+  br label %loop_begin
+
+loop_begin:
+  br bool true, label %loop_body.1, label %loop_exit2
+
+loop_body.1:
+  %X.1 = add int 0, 1
+  %rel.1 = call bool %c1()
+  br bool %rel.1, label %loop_exit, label %loop_body.2
+  
+loop_body.2:
+  %rel.2 = call bool %c2()
+  br bool %rel.2, label %loop_exit, label %loop_begin
+
+loop_exit:
+  ret int %X.1
+  
+loop_exit2:
+  ret int 1
+}