1# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
2--- |
3  define void @baz() #0 {
4    ret void
5  }
6
7  define void @bar(i32 %a) #0 {
8    ret void
9  }
10
11  attributes #0 = { noredzone }
12...
13---
14
15name:            bar
16tracksRegLiveness: true
17body:             |
18  bb.0:
19    liveins: $w0, $lr, $w8
20    $sp = frame-setup SUBXri $sp, 32, 0
21    $fp = frame-setup ADDXri $sp, 16, 0
22
23  bb.1:
24    BL @baz, implicit-def dead $lr, implicit $sp
25    $w17 = ORRWri $wzr, 1
26    $w17 = ORRWri $wzr, 1
27    $w0 = ORRWri $wzr, 4
28
29    BL @baz, implicit-def dead $lr, implicit $sp
30    $w17 = ORRWri $wzr, 1
31    $w17 = ORRWri $wzr, 1
32    $w0 = ORRWri $wzr, 3
33
34    BL @baz, implicit-def dead $lr, implicit $sp
35    $w17 = ORRWri $wzr, 1
36    $w17 = ORRWri $wzr, 1
37    $w0 = ORRWri $wzr, 2
38
39    BL @baz, implicit-def dead $lr, implicit $sp
40    $w17 = ORRWri $wzr, 1
41    $w17 = ORRWri $wzr, 1
42    $w0 = ORRWri $wzr, 1
43
44
45  bb.2:
46    $fp, $lr = LDPXi $sp, 2
47    RET undef $lr
48...
49---
50name:            baz
51tracksRegLiveness: true
52body:             |
53  bb.0:
54    liveins: $w0, $lr, $w8
55    RET undef $lr
56
57# CHECK: name:            OUTLINED_FUNCTION_0
58# CHECK-DAG: bb.0:
59# CHECK-DAG: frame-setup CFI_INSTRUCTION def_cfa_offset -16
60# CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $w30, 16
61# CHECK-NEXT: early-clobber $sp = STRXpre $lr, $sp, -16
62# CHECK-NEXT: BL @baz, implicit-def dead $lr, implicit $sp
63# CHECK-NEXT: $w17 = ORRWri $wzr, 1
64# CHECK-NEXT: $w17 = ORRWri $wzr, 1
65# CHECK-NEXT: early-clobber $sp, $lr = LDRXpost $sp, 16
66# CHECK-NEXT: RET undef $lr
67