aboutsummaryrefslogtreecommitdiffstats
path: root/test/Other/2003-02-19-LoopInfoNestingBug.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Other/2003-02-19-LoopInfoNestingBug.ll')
-rw-r--r--test/Other/2003-02-19-LoopInfoNestingBug.ll28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Other/2003-02-19-LoopInfoNestingBug.ll b/test/Other/2003-02-19-LoopInfoNestingBug.ll
new file mode 100644
index 0000000..ebad6ba
--- /dev/null
+++ b/test/Other/2003-02-19-LoopInfoNestingBug.ll
@@ -0,0 +1,28 @@
+; 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: llvm-upgrade < %s | llvm-as | opt -analyze -loops | \
+; RUN: grep { Loop Containing:\[ \]*%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
+}