2003-02-20 01:09:26 +01:00
|
|
|
; 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"
|
|
|
|
;
|
2009-09-11 20:01:28 +02:00
|
|
|
; RUN: opt < %s -analyze -loops | \
|
2009-10-25 01:52:07 +02:00
|
|
|
; RUN: grep { Loop at depth 3 containing: %Inner<header><latch><exiting>}
|
2003-02-20 01:09:26 +01:00
|
|
|
;
|
2008-02-19 02:44:26 +01:00
|
|
|
define void @test() {
|
|
|
|
br label %Top
|
2003-02-20 01:09:26 +01:00
|
|
|
|
2008-02-19 02:44:26 +01:00
|
|
|
Top: ; preds = %Out, %0
|
|
|
|
br label %LoopHeader
|
2003-02-20 01:09:26 +01:00
|
|
|
|
2008-02-19 02:44:26 +01:00
|
|
|
Next: ; preds = %LoopHeader
|
|
|
|
br i1 false, label %Inner, label %Out
|
2003-02-20 01:09:26 +01:00
|
|
|
|
2008-02-19 02:44:26 +01:00
|
|
|
Inner: ; preds = %Inner, %Next
|
|
|
|
br i1 false, label %Inner, label %LoopHeader
|
2003-02-20 01:09:26 +01:00
|
|
|
|
2008-02-19 02:44:26 +01:00
|
|
|
LoopHeader: ; preds = %Inner, %Top
|
|
|
|
br label %Next
|
2003-02-20 01:09:26 +01:00
|
|
|
|
2008-02-19 02:44:26 +01:00
|
|
|
Out: ; preds = %Next
|
|
|
|
br i1 false, label %Top, label %Done
|
|
|
|
|
|
|
|
Done: ; preds = %Out
|
|
|
|
ret void
|
2003-02-20 01:09:26 +01:00
|
|
|
}
|
2008-02-19 02:44:26 +01:00
|
|
|
|