diff test/Other/2003-02-19-LoopInfoNestingBug.ll @ 0:95c75e76d11b LLVM3.4

LLVM 3.4
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Thu, 12 Dec 2013 13:56:28 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/Other/2003-02-19-LoopInfoNestingBug.ll	Thu Dec 12 13:56:28 2013 +0900
@@ -0,0 +1,29 @@
+; 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: opt < %s -analyze -loops | \
+; RUN:   grep "     Loop at depth 3 containing: %Inner<header><latch><exiting>"
+;
+define void @test() {
+        br label %Top
+
+Top:            ; preds = %Out, %0
+        br label %LoopHeader
+
+Next:           ; preds = %LoopHeader
+        br i1 false, label %Inner, label %Out
+
+Inner:          ; preds = %Inner, %Next
+        br i1 false, label %Inner, label %LoopHeader
+
+LoopHeader:             ; preds = %Inner, %Top
+        br label %Next
+
+Out:            ; preds = %Next
+        br i1 false, label %Top, label %Done
+
+Done:           ; preds = %Out
+        ret void
+}
+