blob: 32390f49a20d311ce16712476d480514c5b04b46 [file] [log] [blame]
Chris Lattnere9d00702003-02-20 00:09:26 +00001; LoopInfo is incorrectly calculating loop nesting! In this case it doesn't
2; figure out that loop "Inner" should be nested inside of leep "LoopHeader",
3; and instead nests it just inside loop "Top"
4;
Tanya Lattner2ad38be2008-02-19 01:44:26 +00005; RUN: llvm-as < %s | opt -analyze -loops | \
Reid Spencera9338b62007-04-15 10:26:05 +00006; RUN: grep { Loop Containing:\[ \]*%Inner}
Chris Lattnere9d00702003-02-20 00:09:26 +00007;
Tanya Lattner2ad38be2008-02-19 01:44:26 +00008define void @test() {
9 br label %Top
Chris Lattnere9d00702003-02-20 00:09:26 +000010
Tanya Lattner2ad38be2008-02-19 01:44:26 +000011Top: ; preds = %Out, %0
12 br label %LoopHeader
Chris Lattnere9d00702003-02-20 00:09:26 +000013
Tanya Lattner2ad38be2008-02-19 01:44:26 +000014Next: ; preds = %LoopHeader
15 br i1 false, label %Inner, label %Out
Chris Lattnere9d00702003-02-20 00:09:26 +000016
Tanya Lattner2ad38be2008-02-19 01:44:26 +000017Inner: ; preds = %Inner, %Next
18 br i1 false, label %Inner, label %LoopHeader
Chris Lattnere9d00702003-02-20 00:09:26 +000019
Tanya Lattner2ad38be2008-02-19 01:44:26 +000020LoopHeader: ; preds = %Inner, %Top
21 br label %Next
Chris Lattnere9d00702003-02-20 00:09:26 +000022
Tanya Lattner2ad38be2008-02-19 01:44:26 +000023Out: ; preds = %Next
24 br i1 false, label %Top, label %Done
25
26Done: ; preds = %Out
27 ret void
Chris Lattnere9d00702003-02-20 00:09:26 +000028}
Tanya Lattner2ad38be2008-02-19 01:44:26 +000029