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: nop 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: : 22; CHECK-FP-NEXT: .cfi_def_cfa_offset 16 23; CHECK-FP-NEXT: : 24; CHECK-FP-NEXT: .cfi_offset %rbp, -16 25; CHECK-FP-NEXT: movq %rsp, %rbp 26; CHECK-FP-NEXT: : 27; CHECK-FP-NEXT: .cfi_def_cfa_register %rbp 28; CHECK-FP-NEXT: .cfi_endproc 29 30; An empty function is perfectly fine on ELF. 31; LINUX-NO-FP: func: 32; LINUX-NO-FP-NEXT: .cfi_startproc 33; LINUX-NO-FP-NEXT: {{^}}# 34; LINUX-NO-FP-NEXT: {{^}}.L{{.*}}:{{$}} 35; LINUX-NO-FP-NEXT: .size func, .L{{.*}}-func 36; LINUX-NO-FP-NEXT: .cfi_endproc 37 38; A cfi directive can point to the end of a function. It (and in fact the 39; entire body) could be optimized out because of the unreachable, but we 40; don't do it right now. 41; LINUX-FP: func: 42; LINUX-FP-NEXT: .cfi_startproc 43; LINUX-FP-NEXT: {{^}}# 44; LINUX-FP-NEXT: pushq %rbp 45; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} 46; LINUX-FP-NEXT: .cfi_def_cfa_offset 16 47; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}} 48; LINUX-FP-NEXT: .cfi_offset %rbp, -16 49; LINUX-FP-NEXT: movq %rsp, %rbp 50; LINUX-FP-NEXT:{{^}}.L{{.*}}:{{$}} 51; LINUX-FP-NEXT: .cfi_def_cfa_register %rbp 52; LINUX-FP-NEXT:{{^}}.L{{.*}}:{{$}} 53; LINUX-FP-NEXT: .size func, .Lfunc_end0-func 54; LINUX-FP-NEXT: .cfi_endproc 55