1; RUN: opt < %s -S -loop-rotate -disable-output -verify-loop-info -verify-dom-info
2; PR5502
3
4define void @z80_do_opcodes() nounwind {
5entry:
6  br label %while.cond
7
8while.cond:                                       ; preds = %end_opcode, %entry
9  br label %while.body
10
11while.body:                                       ; preds = %while.cond
12  br label %indirectgoto
13
14run_opcode:                                       ; preds = %indirectgoto
15  %tmp276 = load i8, i8* undef                        ; <i8> [#uses=1]
16  br label %indirectgoto
17
18if.else295:                                       ; preds = %divide_late
19  br label %end_opcode
20
21end_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
26  ]
27
28sw.bb11691:                                       ; preds = %end_opcode
29  br label %sw.default
30
31sw.default:                                       ; preds = %sw.bb11691
32  br label %end_opcode
33
34sw.bb30351:                                       ; preds = %end_opcode
35  br label %sw.default42406
36
37sw.default42406:                                  ; preds = %sw.bb30351
38  br label %end_opcode
39
40indirectgoto:                                     ; preds = %run_opcode, %while.body
41  %opcode.0 = phi i8 [ undef, %while.body ], [ %tmp276, %run_opcode ] ; <i8> [#uses=2]
42  indirectbr i8* undef, [label %run_opcode, label %if.else295, label %end_opcode]
43}
44