1 # RUN: llc %s -o - -run-pass=if-converter -verify-machineinstrs | FileCheck %s
2 # Make sure we correctly if-convert blocks containing an INLINEASM_BR.
3 # CHECK: t2CMPri killed renamable $r2, 34
4 # CHECK-NEXT: $r0 = t2MOVi 2, 1, $cpsr, $noreg
5 # CHECK-NEXT: $r0 = t2MOVi 3, 0, killed $cpsr, $noreg, implicit killed $r0
6 # CHECK-NEXT: tBL 14, $noreg, @fn2
7 # CHECK-NEXT: INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
8 # CHECK-NEXT: t2B %bb.1, 14, $noreg
10 target triple = "thumbv7-unknown-linux-gnueabi"
12 define dso_local void @fn1() {
17 declare dso_local i32 @fn2(...)
22 tracksRegLiveness: true
25 successors: %bb.1(0x40000000), %bb.2(0x40000000)
26 liveins: $r0, $r1, $r2, $r4, $lr
28 $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r4, killed $lr
29 t2CMPri killed renamable $r2, 34, 14, $noreg, implicit-def $cpsr
30 t2Bcc %bb.2, 1, killed $cpsr
33 successors: %bb.3(0x40000000), %bb.4(0x40000000)
36 $r0 = t2MOVi 3, 14, $noreg, $noreg
37 tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
38 INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
42 successors: %bb.3(0x40000000), %bb.4(0x40000000)
45 $r0 = t2MOVi 2, 14, $noreg, $noreg
46 tBL 14, $noreg, @fn2, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit $r1, implicit-def $sp, implicit-def dead $r0
47 INLINEASM_BR &"", 9, 13, 0, 13, blockaddress(@fn1, %ir-block.l_yes)
52 $sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc
54 bb.4.l_yes (address-taken):
55 $sp = t2LDMIA_RET $sp, 14, $noreg, def $r4, def $pc