1# RUN: llc -verify-machineinstrs -run-pass=machine-outliner -mtriple=thumbv7m-none-eabi %s -o - | FileCheck %s
2
3# Check the outlined function does not contain debug instructions
4# CHECK-LABEL: name: f
5# CHECK:       tBL {{.*}}  @OUTLINED_FUNCTION_0,
6
7# CHECK-LABEL: name: g
8# CHECK:       tBL {{.*}}  @OUTLINED_FUNCTION_0,
9
10# CHECK-LABEL: name: OUTLINED_FUNCTION_0
11# CHECK-NOT:   DBG_VALUE
12# CHECK:       tTAILJMPdND @h
13--- |
14  define void @f() { entry: ret void }
15
16  define void @g() { entry: ret void }
17
18  declare void @h()
19...
20---
21name:            f
22tracksRegLiveness: true
23body:             |
24  bb.0.entry:
25    liveins: $r0, $r1, $r2, $r3, $r4, $lr
26
27    frame-setup tPUSH 14, $noreg, killed $r4, killed $lr, implicit-def $sp, implicit $sp
28
29    $r4 = tMOVr $r1, 14, $noreg
30    DBG_VALUE $r4, $noreg
31    renamable $r0, dead $cpsr = nsw tMUL renamable $r1, killed renamable $r0, 14, $noreg
32    renamable $r0, dead $cpsr = nsw tSUBrr killed renamable $r0, renamable $r1, 14, $noreg
33    tBL 14, $noreg, @h, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit-def $sp, implicit-def $r0
34
35    frame-destroy tPOP_RET 14, $noreg, def $r4, def $pc, implicit killed $r0
36...
37---
38name:            g
39tracksRegLiveness: true
40body:             |
41  bb.0.entry:
42    liveins: $r0, $r1, $r2, $r3, $r4, $lr
43
44    frame-setup tPUSH 14, $noreg, killed $r4, killed $lr, implicit-def $sp, implicit $sp
45
46    $r4 = tMOVr $r1, 14, $noreg
47    DBG_VALUE $r4, $noreg
48    renamable $r0, dead $cpsr = nsw tMUL renamable $r1, killed renamable $r0, 14, $noreg
49    renamable $r0, dead $cpsr = nsw tSUBrr killed renamable $r0, renamable $r1, 14, $noreg
50    tBL 14, $noreg, @h, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit killed $r0, implicit killed $r1, implicit-def $sp, implicit-def $r0
51
52    frame-destroy tPOP_RET 14, $noreg, def $r4, def $pc, implicit killed $r0
53...
54