aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll')
-rw-r--r--test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll b/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
new file mode 100644
index 000000000000..ea74692d05f7
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
@@ -0,0 +1,22 @@
+; This test checks to make sure that 'br X, Dest, Dest' is folded into
+; 'br Dest'
+
+; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | \
+; RUN: not grep {br i1 %c2}
+
+declare void @noop()
+
+define i32 @test(i1 %c1, i1 %c2) {
+ call void @noop( )
+ br i1 %c1, label %A, label %Y
+A: ; preds = %0
+ call void @noop( )
+ br i1 %c2, label %X, label %X
+X: ; preds = %Y, %A, %A
+ call void @noop( )
+ ret i32 0
+Y: ; preds = %0
+ call void @noop( )
+ br label %X
+}
+