1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc < %s -x mir -mtriple=thumbv7m-arm-none-eabi -run-pass=arm-branch-targets | FileCheck %s
4 define internal i32 @table_switch(i32 %x) {
6 switch i32 %x, label %sw.epilog [
26 %ret = phi i32 [ 0, %sw.epilog ], [ 2, %bb2 ], [ 3, %bb3 ], [ 4, %bb4 ], [ 1, %entry ]
30 !llvm.module.flags = !{!0}
31 !0 = !{i32 8, !"branch-target-enforcement", i32 1}
37 tracksRegLiveness: true
43 machineFunctionInfo: {}
48 blocks: [ '%bb.6', '%bb.2', '%bb.3', '%bb.4' ]
50 ; CHECK-LABEL: name: table_switch
52 ; CHECK: successors: %bb.3(0x40000000), %bb.1(0x40000000)
54 ; CHECK: renamable $r1, dead $cpsr = tSUBi3 killed renamable $r0, 1, 14 /* CC::al */, $noreg
55 ; CHECK: tCMPi8 renamable $r1, 3, 14 /* CC::al */, $noreg, implicit-def $cpsr
56 ; CHECK: t2Bcc %bb.3, 8 /* CC::hi */, killed $cpsr
58 ; CHECK: successors: %bb.4(0x20000000), %bb.2(0x20000000), %bb.5(0x20000000), %bb.6(0x20000000)
60 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
61 ; CHECK: renamable $r2 = t2LEApcrelJT %jump-table.0, 14 /* CC::al */, $noreg
62 ; CHECK: renamable $r2 = t2ADDrs killed renamable $r2, renamable $r1, 18, 14 /* CC::al */, $noreg, $noreg
63 ; CHECK: t2BR_JT killed renamable $r2, killed renamable $r1, %jump-table.0
65 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 2, 14 /* CC::al */, $noreg
66 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r0
67 ; CHECK: bb.3.sw.epilog:
68 ; CHECK: successors: %bb.4(0x80000000)
69 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
72 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r0
74 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 3, 14 /* CC::al */, $noreg
75 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r0
77 ; CHECK: renamable $r0, dead $cpsr = tMOVi8 4, 14 /* CC::al */, $noreg
78 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r0
80 successors: %bb.5, %bb.1
83 renamable $r1, dead $cpsr = tSUBi3 killed renamable $r0, 1, 14 /* CC::al */, $noreg
84 tCMPi8 renamable $r1, 3, 14 /* CC::al */, $noreg, implicit-def $cpsr
85 t2Bcc %bb.5, 8 /* CC::hi */, killed $cpsr
88 successors: %bb.6, %bb.2, %bb.3, %bb.4
91 renamable $r0, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
92 renamable $r2 = t2LEApcrelJT %jump-table.0, 14 /* CC::al */, $noreg
93 renamable $r2 = t2ADDrs killed renamable $r2, renamable $r1, 18, 14 /* CC::al */, $noreg, $noreg
94 t2BR_JT killed renamable $r2, killed renamable $r1, %jump-table.0
97 renamable $r0, dead $cpsr = tMOVi8 2, 14 /* CC::al */, $noreg
98 tBX_RET 14 /* CC::al */, $noreg, implicit $r0
101 renamable $r0, dead $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
106 tBX_RET 14 /* CC::al */, $noreg, implicit $r0
109 renamable $r0, dead $cpsr = tMOVi8 3, 14 /* CC::al */, $noreg
110 tBX_RET 14 /* CC::al */, $noreg, implicit $r0
113 renamable $r0, dead $cpsr = tMOVi8 4, 14 /* CC::al */, $noreg
114 tBX_RET 14 /* CC::al */, $noreg, implicit $r0