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 -disable-fp-elim | 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 -disable-fp-elim | FileCheck -check-prefix=LINUX-FP %s 5 6define void @func() { 7entry: 8 unreachable 9} 10 11; MachO cannot handle an empty function. 12; CHECK-NO-FP: _func: 13; CHECK-NO-FP-NEXT: .cfi_startproc 14; CHECK-NO-FP: ud2 15; CHECK-NO-FP-NEXT: .cfi_endproc 16 17; CHECK-FP: _func: 18; CHECK-FP-NEXT: .cfi_startproc 19; CHECK-FP-NEXT: : 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 24; CHECK-FP: ud2 25; CHECK-FP: .cfi_endproc 26 27; An empty function is perfectly fine on ELF. 28; LINUX-NO-FP: func: 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 34 35; A cfi directive cannot point to the end of a function. 36; LINUX-FP: func: 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 46