1 ; RUN: opt < %s -passes=loop-simplify -S | FileCheck %s
3 ; Make sure the preheader exists.
5 ; CHECK: indirectbr {{.*}}label %while.cond112
6 ; CHECK: while.cond112:
7 ; But the tail is not split.
9 ; CHECK: indirectbr {{.*}}label %while.cond112
10 define fastcc void @build_regex_nfa() nounwind uwtable ssp {
12 indirectbr ptr blockaddress(@build_regex_nfa, %while.cond), [label %while.cond]
14 while.cond: ; preds = %if.then439, %entry
15 indirectbr ptr blockaddress(@build_regex_nfa, %sw.bb103), [label %do.body785, label %sw.bb103]
17 sw.bb103: ; preds = %while.body
18 indirectbr ptr blockaddress(@build_regex_nfa, %while.cond112), [label %while.cond112]
20 while.cond112: ; preds = %for.body, %for.cond.preheader, %sw.bb103
21 %pc.0 = phi i8 [ -1, %sw.bb103 ], [ 0, %for.body ], [ %pc.0, %for.cond.preheader ]
22 indirectbr ptr blockaddress(@build_regex_nfa, %Lsetdone), [label %sw.bb118, label %Lsetdone]
24 sw.bb118: ; preds = %while.cond112
25 indirectbr ptr blockaddress(@build_regex_nfa, %for.cond.preheader), [label %Lerror.loopexit, label %for.cond.preheader]
27 for.cond.preheader: ; preds = %sw.bb118
28 indirectbr ptr blockaddress(@build_regex_nfa, %for.body), [label %while.cond112, label %for.body]
30 for.body: ; preds = %for.body, %for.cond.preheader
31 indirectbr ptr blockaddress(@build_regex_nfa, %for.body), [label %while.cond112, label %for.body]
33 Lsetdone: ; preds = %while.cond112
36 do.body785: ; preds = %while.cond, %while.body
39 Lerror.loopexit: ; preds = %sw.bb118