1 ; RUN: opt < %s -passes=loop-simplify,lcssa -verify-loop-info -verify-dom-info -S \
2 ; RUN: | grep -F "indirectbr ptr %x, [label %L0, label %L1]" \
5 ; LoopSimplify should not try to transform loops when indirectbr is involved.
7 define void @entry(ptr %x) {
9 indirectbr ptr %x, [ label %L0, label %L1 ]
18 define void @backedge(ptr %x) {
26 indirectbr ptr %x, [ label %L0, label %L1 ]
29 define i64 @exit(ptr %x) {
34 %z = bitcast i64 0 to i64
35 indirectbr ptr %x, [ label %L0, label %L1 ]
44 define i64 @criticalexit(ptr %x, i1 %a) {
46 br i1 %a, label %L1, label %L2
49 %z = bitcast i64 0 to i64
50 indirectbr ptr %x, [ label %L0, label %L1 ]
56 %y = phi i64 [ %z, %L2 ], [ 1, %entry ]
60 define i64 @exit_backedge(ptr %x) {
65 %z = bitcast i64 0 to i64
66 indirectbr ptr %x, [ label %L0, label %L1 ]
72 define i64 @criticalexit_backedge(ptr %x, i1 %a) {
74 br i1 %a, label %L0, label %L1
77 %z = bitcast i64 0 to i64
78 indirectbr ptr %x, [ label %L0, label %L1 ]
81 %y = phi i64 [ %z, %L0 ], [ 1, %entry ]
85 define void @pr5502() nounwind {
90 br i1 undef, label %while.body, label %while.end
93 indirectbr ptr undef, [label %end_opcode, label %end_opcode]
96 br i1 false, label %end_opcode, label %while.cond