1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck -check-prefix=CHECK-NO-FP %s
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -frame-pointer=all | FileCheck -check-prefix=CHECK-FP %s
3 ; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=LINUX-NO-FP %s
4 ; RUN: llc < %s -mtriple=x86_64-linux-gnu -frame-pointer=all | FileCheck -check-prefix=LINUX-FP %s
11 ; MachO cannot handle an empty function.
13 ; CHECK-NO-FP-NEXT: .cfi_startproc
15 ; CHECK-NO-FP-NEXT: .cfi_endproc
18 ; CHECK-FP-NEXT: .cfi_startproc
20 ; CHECK-FP-NEXT: pushq %rbp
21 ; CHECK-FP-NEXT: .cfi_def_cfa_offset 16
22 ; CHECK-FP-NEXT: .cfi_offset %rbp, -16
23 ; CHECK-FP-NEXT: movq %rsp, %rbp
25 ; CHECK-FP: .cfi_endproc
27 ; An empty function is perfectly fine on ELF.
29 ; LINUX-NO-FP-NEXT: .cfi_startproc
30 ; LINUX-NO-FP-NEXT: {{^}}#
31 ; LINUX-NO-FP-NEXT: {{^}}.L{{.*}}:{{$}}
32 ; LINUX-NO-FP-NEXT: .size func, .L{{.*}}-func
33 ; LINUX-NO-FP-NEXT: .cfi_endproc
35 ; A cfi directive cannot point to the end of a function.
37 ; LINUX-FP-NEXT: .cfi_startproc
38 ; LINUX-FP-NEXT: {{^}}#
39 ; LINUX-FP-NEXT: pushq %rbp
40 ; LINUX-FP-NEXT: .cfi_def_cfa_offset 16
41 ; LINUX-FP-NEXT: .cfi_offset %rbp, -16
42 ; LINUX-FP-NEXT: movq %rsp, %rbp
43 ; LINUX-FP-NEXT:{{^}}.L{{.*}}:{{$}}
44 ; LINUX-FP-NEXT: .size func, .Lfunc_end0-func
45 ; LINUX-FP-NEXT: .cfi_endproc