1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-apple-unknown -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
4 # Outlining CFI instructions is unsafe if we cannot outline all of the CFI
5 # instructions from a function. This shows that we choose to outline the
6 # CFI instructions if they can be included in a tail call.
9 define void @foo() #0 { ret void }
10 define void @bar() #0 { ret void }
11 define void @baz() #0 { ret void }
12 attributes #0 = { noredzone }
16 tracksRegLiveness: true
19 ; CHECK-LABEL: name: foo
20 ; CHECK: $ecx = MOV32ri 3
21 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
22 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
23 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
24 ; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
26 CFI_INSTRUCTION def_cfa_offset 16
27 CFI_INSTRUCTION offset $rbp, -16
28 CFI_INSTRUCTION def_cfa_register $rsp
37 tracksRegLiveness: true
41 ; CHECK-LABEL: name: bar
42 ; CHECK: $ecx = MOV32ri 3
43 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
44 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
45 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
46 ; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
48 CFI_INSTRUCTION def_cfa_offset 16
49 CFI_INSTRUCTION offset $rbp, -16
50 CFI_INSTRUCTION def_cfa_register $rsp
59 tracksRegLiveness: true
63 ; CHECK-LABEL: name: baz
64 ; CHECK: $ecx = MOV32ri 3
65 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
66 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
67 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
68 ; CHECK: TAILJMPd64 @OUTLINED_FUNCTION_0, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $edi, implicit-def $edx, implicit-def $esi, implicit $rsp, implicit $ssp
70 CFI_INSTRUCTION def_cfa_offset 16
71 CFI_INSTRUCTION offset $rbp, -16
72 CFI_INSTRUCTION def_cfa_register $rsp