Add a testcase for broken loopinfo
authorChris Lattner <sabre@nondot.org>
Thu, 20 Feb 2003 00:09:26 +0000 (00:09 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 20 Feb 2003 00:09:26 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5602 91177308-0d34-0410-b5e6-96231b3b80d8

test/Other/2003-02-19-LoopInfoNestingBug.ll [new file with mode: 0644]

diff --git a/test/Other/2003-02-19-LoopInfoNestingBug.ll b/test/Other/2003-02-19-LoopInfoNestingBug.ll
new file mode 100644 (file)
index 0000000..78338b8
--- /dev/null
@@ -0,0 +1,27 @@
+; LoopInfo is incorrectly calculating loop nesting!  In this case it doesn't 
+; figure out that loop "Inner" should be nested inside of leep "LoopHeader", 
+; and instead nests it just inside loop "Top"
+;
+; RUN: analyze -loops %s | grep '     Loop Containing: label %Inner'
+;
+
+implementation
+
+void %test() {
+       br label %Top
+Top:
+       br label %LoopHeader
+Next:
+       br bool false, label %Inner, label %Out
+Inner:
+       br bool false, label %Inner, label %LoopHeader
+
+LoopHeader:
+       br label %Next
+
+Out:
+       br bool false, label %Top, label %Done
+
+Done:
+       ret void
+}