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 not to outline the
6 # CFI instructions since function foo has a CFI Instruction that would not
10 define void @foo() #0 { ret void }
11 define void @bar() #0 { ret void }
12 define void @baz() #0 { ret void }
13 attributes #0 = { noredzone }
17 tracksRegLiveness: true
20 ; CHECK-LABEL: name: foo
21 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
22 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
23 ; CHECK: CFI_INSTRUCTION def_cfa_register $rbp
24 ; CHECK: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
25 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
26 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
27 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
28 ; 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
29 CFI_INSTRUCTION def_cfa_offset 16
30 CFI_INSTRUCTION offset $rbp, -16
31 CFI_INSTRUCTION def_cfa_register $rbp
35 CFI_INSTRUCTION def_cfa_offset 16
36 CFI_INSTRUCTION offset $rbp, -16
37 CFI_INSTRUCTION def_cfa_register $rsp
46 tracksRegLiveness: true
50 ; CHECK-LABEL: name: bar
51 ; CHECK: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
52 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
53 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
54 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
55 ; 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
59 CFI_INSTRUCTION def_cfa_offset 16
60 CFI_INSTRUCTION offset $rbp, -16
61 CFI_INSTRUCTION def_cfa_register $rsp
70 tracksRegLiveness: true
74 ; CHECK-LABEL: name: baz
75 ; CHECK: CALL64pcrel32 @OUTLINED_FUNCTION_1, implicit $rsp, implicit $ssp, implicit-def $eax, implicit-def $ebx, implicit-def $ecx, implicit $rsp, implicit $ssp
76 ; CHECK: CFI_INSTRUCTION def_cfa_offset 16
77 ; CHECK: CFI_INSTRUCTION offset $rbp, -16
78 ; CHECK: CFI_INSTRUCTION def_cfa_register $rsp
79 ; 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
83 CFI_INSTRUCTION def_cfa_offset 16
84 CFI_INSTRUCTION offset $rbp, -16
85 CFI_INSTRUCTION def_cfa_register $rsp