xref: /minix3/external/bsd/llvm/dist/llvm/test/Transforms/LoopSimplify/unreachable-loop-pred.ll (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc; RUN: opt -S -loop-simplify -disable-output -verify-loop-info -verify-dom-info < %s
2*f4a2713aSLionel Sambuc; PR5235
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc; When loopsimplify inserts a preheader for this loop, it should add the new
5*f4a2713aSLionel Sambuc; block to the enclosing loop and not get confused by the unreachable
6*f4a2713aSLionel Sambuc; bogus loop entry.
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucdefine void @is_extract_cab() nounwind {
9*f4a2713aSLionel Sambucentry:
10*f4a2713aSLionel Sambuc  br label %header
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambucheader:                                       ; preds = %if.end206, %cond.end66, %if.end23
13*f4a2713aSLionel Sambuc  br label %while.body115
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambucwhile.body115:                                    ; preds = %9, %if.end192, %if.end101
16*f4a2713aSLionel Sambuc  br i1 undef, label %header, label %while.body115
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambucfoo:
19*f4a2713aSLionel Sambuc  br label %while.body115
20*f4a2713aSLionel Sambuc}
21