1 ; RUN: llc < %s -mtriple thumbv7s-apple-darwin -asm-verbose=false | FileCheck %s
2 ; RUN: llc < %s -mtriple thumbv7s-apple-darwin -asm-verbose=false -print-machineinstrs=if-converter 2>&1 | FileCheck --check-prefix=CHECK-PROB %s
5 declare i8* @bar(i32, i8*, i8*)
7 ; Verify that we don't try to iteratively re-ifconvert a block with a
8 ; (predicated) indirectbr terminator.
9 ; If we do, we would ignore its fallthrough successor.
13 ; CHECK: cmp {{.*}}, #21
16 ; CHECK-NEXT: moveq pc
17 ; CHECK-NEXT: LBB{{[0-9_]+}}:
18 ; CHECK-NEXT: cmp {{.*}}, #42
19 ; CHECK-NEXT: beq [[CALL_FOO_1234:LBB[0-9_]+]]
20 ; CHECK-NEXT: ldr {{.*}}[sp
24 ; CHECK-NEXT: [[CALL_FOO_1234]]:
25 ; CHECK-NEXT: movw r0, #1234
26 ; CHECK-NEXT: b [[FOOCALL:LBB[0-9_]+]]
28 ; CHECK-NEXT: LBB{{[0-9_]+}}:
29 ; CHECK-NEXT: movw r0, #4567
30 ; CHECK-NEXT: [[FOOCALL]]:
33 ; CHECK-PROB: bb.0{{[0-9a-zA-Z.]*}}:
34 ; CHECK-PROB: successors: %bb.1(0x40000000), %bb.3(0x20000000), %bb.5(0x20000000)
35 ; CHECK-PROB: bb.2{{[0-9a-zA-Z.]*}}:
36 ; CHECK-PROB: successors: %bb.3(0x40000000), %bb.5(0x40000000)
38 define i32 @test(i32 %a, i32 %a2, i32* %p, i32* %p2) "no-frame-pointer-elim"="true" {
40 %dst1 = call i8* @bar(i32 1, i8* blockaddress(@test, %bb1), i8* blockaddress(@test, %bb2))
41 %dst2 = call i8* @bar(i32 2, i8* blockaddress(@test, %bb1), i8* blockaddress(@test, %bb2))
42 %dst3 = call i8* @bar(i32 3, i8* blockaddress(@test, %bb1), i8* blockaddress(@test, %bb2))
43 %cc1 = icmp eq i32 %a, 21
44 br i1 %cc1, label %cc1t, label %cc1f
48 indirectbr i8* %dst3, [label %bb1, label %bb2]
51 %cc2 = icmp ne i32 %a2, 42
52 br i1 %cc2, label %cc2t, label %bb1
54 store i32 %a, i32* %p2
55 indirectbr i8* %dst1, [label %bb1, label %bb2]
58 %ret_bb1 = call i32 @foo(i32 1234)
61 %ret_bb2 = call i32 @foo(i32 4567)