aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-17 19:29:34 +0000
committerChris Lattner <sabre@nondot.org>2003-08-17 19:29:34 +0000
commit128cf79bcc57124ff646b4c7b701cef44306fab8 (patch)
tree52b17288d6ae2b6416c1510187d7c40581e9d32e
parent5b007e248c0ade9fd8e519ca45ae5b03316b2cda (diff)
downloadexternal_llvm-128cf79bcc57124ff646b4c7b701cef44306fab8.zip
external_llvm-128cf79bcc57124ff646b4c7b701cef44306fab8.tar.gz
external_llvm-128cf79bcc57124ff646b4c7b701cef44306fab8.tar.bz2
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7918 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll20
1 files changed, 20 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 0000000..da15180
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/2003-08-17-BranchFold.ll
@@ -0,0 +1,20 @@
+; This test checks to make sure that 'br X, Dest, Dest' is folded into
+; 'br Dest'
+
+; RUN: as < %s | opt -simplifycfg | dis | not grep 'br bool %c2'
+
+declare void %noop()
+
+int %test(bool %c1, bool %c2) {
+ call void %noop()
+ br bool %c1, label %A, label %Y
+A:
+ call void %noop()
+ br bool %c2, label %X, label %X ; Can be converted to unconditional br
+X:
+ call void %noop()
+ ret int 0
+Y:
+ call void %noop()
+ br label %X
+}