1 ; RUN: opt < %s -S -passes=loop-rotate -o - -verify-loop-info -verify-dom-info -verify-memoryssa | FileCheck %s
4 define void @z80_do_opcodes() nounwind {
8 while.cond: ; preds = %end_opcode, %entry
11 while.body: ; preds = %while.cond
12 br label %indirectgoto
14 run_opcode: ; preds = %indirectgoto
15 %tmp276 = load i8, ptr undef ; <i8> [#uses=1]
16 br label %indirectgoto
18 if.else295: ; preds = %divide_late
21 end_opcode: ; preds = %indirectgoto, %sw.default42406, %sw.default, %if.else295
22 %opcode.2 = phi i8 [ %opcode.0, %indirectgoto ], [ 0, %sw.default42406 ], [ undef, %sw.default ], [ %opcode.0, %if.else295 ] ; <i8> [#uses=0]
23 switch i32 undef, label %while.cond [
24 i32 221, label %sw.bb11691
25 i32 253, label %sw.bb30351
28 sw.bb11691: ; preds = %end_opcode
31 sw.default: ; preds = %sw.bb11691
34 sw.bb30351: ; preds = %end_opcode
35 br label %sw.default42406
37 sw.default42406: ; preds = %sw.bb30351
40 indirectgoto: ; preds = %run_opcode, %while.body
41 %opcode.0 = phi i8 [ undef, %while.body ], [ %tmp276, %run_opcode ] ; <i8> [#uses=2]
42 indirectbr ptr undef, [label %run_opcode, label %if.else295, label %end_opcode]
46 define void @foo(i1 %a, i1 %b, ptr %c) {
48 ; CHECK-NEXT: br i1 %a, label %return, label %preheader
50 br i1 %a, label %return, label %preheader
53 ; CHECK-NEXT: br label %header
58 ; CHECK-NEXT: br i1 %b, label %return, label %body
60 br i1 %b, label %return, label %body
63 ; CHECK-NEXT: indirectbr ptr %c, [label %return, label %latch]
65 indirectbr ptr %c, [label %return, label %latch]
68 ; CHECK-NEXT: br label %header