1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
4 # Verify that we save + restore LR around calls to outlined functions from
5 # noreturn parents. LR isn't actually used, but debuggers need LR in this case
9 define void @save_lr_1() #0 { ret void }
10 define void @save_lr_2() #0 { ret void }
11 define void @save_lr_3() #0 { ret void }
12 define void @save_lr_4() #0 { ret void }
13 attributes #0 = { noredzone noreturn }
19 tracksRegLiveness: true
23 machineFunctionInfo: {}
27 ; CHECK-LABEL: name: save_lr_1
29 ; CHECK: $x0 = ORRXrs $xzr, $lr, 0
30 ; CHECK: BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $lr, implicit-def $w3, implicit-def $w4, implicit-def $w5, implicit-def $w6, implicit $sp, implicit $wzr, implicit $xzr, implicit $x0
31 ; CHECK: $lr = ORRXrs $xzr, $x0, 0
41 tracksRegLiveness: true
45 machineFunctionInfo: {}
49 ; CHECK-LABEL: name: save_lr_2
51 ; CHECK: $x0 = ORRXrs $xzr, $lr, 0
52 ; CHECK: BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $lr, implicit-def $w3, implicit-def $w4, implicit-def $w5, implicit-def $w6, implicit $sp, implicit $wzr, implicit $xzr, implicit $x0
53 ; CHECK: $lr = ORRXrs $xzr, $x0, 0
63 tracksRegLiveness: true
67 machineFunctionInfo: {}
71 ; CHECK-LABEL: name: save_lr_3
73 ; CHECK: $x0 = ORRXrs $xzr, $lr, 0
74 ; CHECK: BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $lr, implicit-def $w3, implicit-def $w4, implicit-def $w5, implicit-def $w6, implicit $sp, implicit $wzr, implicit $xzr, implicit $x0
75 ; CHECK: $lr = ORRXrs $xzr, $x0, 0
85 tracksRegLiveness: true
89 machineFunctionInfo: {}
93 ; CHECK-LABEL: name: save_lr_4
95 ; CHECK: $x0 = ORRXrs $xzr, $lr, 0
96 ; CHECK: BL @OUTLINED_FUNCTION_0, implicit-def $lr, implicit $sp, implicit-def $lr, implicit-def $w3, implicit-def $w4, implicit-def $w5, implicit-def $w6, implicit $sp, implicit $wzr, implicit $xzr, implicit $x0
97 ; CHECK: $lr = ORRXrs $xzr, $x0, 0