1; RUN: opt < %s -loop-simplify -S | FileCheck %s 2 3; Make sure the preheader exists. 4; CHECK: sw.bb103: 5; CHECK: indirectbr {{.*}}label %while.cond112 6; CHECK: while.cond112: 7; But the tail is not split. 8; CHECK: for.body: 9; CHECK: indirectbr {{.*}}label %while.cond112 10define fastcc void @build_regex_nfa() nounwind uwtable ssp { 11entry: 12 indirectbr i8* blockaddress(@build_regex_nfa, %while.cond), [label %while.cond] 13 14while.cond: ; preds = %if.then439, %entry 15 indirectbr i8* blockaddress(@build_regex_nfa, %sw.bb103), [label %do.body785, label %sw.bb103] 16 17sw.bb103: ; preds = %while.body 18 indirectbr i8* blockaddress(@build_regex_nfa, %while.cond112), [label %while.cond112] 19 20while.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 i8* blockaddress(@build_regex_nfa, %Lsetdone), [label %sw.bb118, label %Lsetdone] 23 24sw.bb118: ; preds = %while.cond112 25 indirectbr i8* blockaddress(@build_regex_nfa, %for.cond.preheader), [label %Lerror.loopexit, label %for.cond.preheader] 26 27for.cond.preheader: ; preds = %sw.bb118 28 indirectbr i8* blockaddress(@build_regex_nfa, %for.body), [label %while.cond112, label %for.body] 29 30for.body: ; preds = %for.body, %for.cond.preheader 31 indirectbr i8* blockaddress(@build_regex_nfa, %for.body), [label %while.cond112, label %for.body] 32 33Lsetdone: ; preds = %while.cond112 34 unreachable 35 36do.body785: ; preds = %while.cond, %while.body 37 ret void 38 39Lerror.loopexit: ; preds = %sw.bb118 40 unreachable 41} 42