2010-07-17 06:51:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck -check-prefix=CHECK-NO-FP %s
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -disable-fp-elim | FileCheck -check-prefix=CHECK-FP %s
|
2014-09-16 02:32:58 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux-gnu | FileCheck -check-prefix=LINUX-NO-FP %s
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux-gnu -disable-fp-elim | FileCheck -check-prefix=LINUX-FP %s
|
2010-07-17 06:51:10 +08:00
|
|
|
|
|
|
|
define void @func() {
|
|
|
|
entry:
|
|
|
|
unreachable
|
|
|
|
}
|
2014-09-16 02:32:58 +08:00
|
|
|
|
|
|
|
; MachO cannot handle an empty function.
|
2010-07-17 06:51:10 +08:00
|
|
|
; CHECK-NO-FP: _func:
|
2011-05-06 02:43:39 +08:00
|
|
|
; CHECK-NO-FP-NEXT: .cfi_startproc
|
2010-07-17 06:51:10 +08:00
|
|
|
; CHECK-NO-FP: nop
|
2011-05-06 02:43:39 +08:00
|
|
|
; CHECK-NO-FP-NEXT: .cfi_endproc
|
2010-07-17 06:51:10 +08:00
|
|
|
|
|
|
|
; CHECK-FP: _func:
|
2011-05-06 02:43:39 +08:00
|
|
|
; CHECK-FP-NEXT: .cfi_startproc
|
|
|
|
; CHECK-FP-NEXT: :
|
|
|
|
; CHECK-FP-NEXT: pushq %rbp
|
|
|
|
; CHECK-FP-NEXT: .cfi_def_cfa_offset 16
|
2011-05-31 04:20:15 +08:00
|
|
|
; CHECK-FP-NEXT: .cfi_offset %rbp, -16
|
2011-05-06 02:43:39 +08:00
|
|
|
; CHECK-FP-NEXT: movq %rsp, %rbp
|
|
|
|
; CHECK-FP-NEXT: .cfi_endproc
|
2014-09-16 02:32:58 +08:00
|
|
|
|
|
|
|
; An empty function is perfectly fine on ELF.
|
|
|
|
; LINUX-NO-FP: func:
|
|
|
|
; LINUX-NO-FP-NEXT: .cfi_startproc
|
|
|
|
; LINUX-NO-FP-NEXT: {{^}}#
|
|
|
|
; LINUX-NO-FP-NEXT: {{^}}.L{{.*}}:{{$}}
|
|
|
|
; LINUX-NO-FP-NEXT: .size func, .L{{.*}}-func
|
|
|
|
; LINUX-NO-FP-NEXT: .cfi_endproc
|
|
|
|
|
2017-04-25 02:45:59 +08:00
|
|
|
; A cfi directive cannot point to the end of a function.
|
2014-09-16 02:32:58 +08:00
|
|
|
; LINUX-FP: func:
|
|
|
|
; LINUX-FP-NEXT: .cfi_startproc
|
|
|
|
; LINUX-FP-NEXT: {{^}}#
|
|
|
|
; LINUX-FP-NEXT: pushq %rbp
|
|
|
|
; LINUX-FP-NEXT: .cfi_def_cfa_offset 16
|
|
|
|
; LINUX-FP-NEXT: .cfi_offset %rbp, -16
|
|
|
|
; LINUX-FP-NEXT: movq %rsp, %rbp
|
|
|
|
; LINUX-FP-NEXT:{{^}}.L{{.*}}:{{$}}
|
2015-03-04 09:35:23 +08:00
|
|
|
; LINUX-FP-NEXT: .size func, .Lfunc_end0-func
|
2014-09-16 02:32:58 +08:00
|
|
|
; LINUX-FP-NEXT: .cfi_endproc
|