Recommit r310809 with a fix for the spill problem
[llvm-core.git] / test / CodeGen / PowerPC / empty-functions.ll
blobb8394e14318fb0eac8e06d2efd7da75828137857
1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-apple-darwin | FileCheck -check-prefix=CHECK-MACHO %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-apple-darwin -disable-fp-elim | FileCheck -check-prefix=CHECK-MACHO %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-linux-gnu | FileCheck -check-prefix=LINUX-NO-FP %s
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-linux-gnu -disable-fp-elim | FileCheck -check-prefix=LINUX-FP %s
6 define void @func() {
7 entry:
8   unreachable
11 ; MachO cannot handle an empty function.
12 ; CHECK-MACHO:     _func:
13 ; CHECK-MACHO-NEXT: .cfi_startproc
14 ; CHECK-MACHO-NEXT: {{^}};
15 ; CHECK-MACHO-NEXT:     nop
16 ; CHECK-MACHO-NEXT: .cfi_endproc
18 ; An empty function is perfectly fine on ELF.
19 ; LINUX-NO-FP: func:
20 ; LINUX-NO-FP-NEXT: {{^}}.L[[BEGIN:.*]]:{{$}}
21 ; LINUX-NO-FP-NEXT: .cfi_startproc
22 ; LINUX-NO-FP-NEXT: {{^}}#
23 ; LINUX-NO-FP-NEXT: {{^}}.L[[END:.*]]:{{$}}
24 ; LINUX-NO-FP-NEXT: .size   func, .L[[END]]-.L[[BEGIN]]
25 ; LINUX-NO-FP-NEXT: .cfi_endproc
27 ; A cfi directive cannot point to the end of a function.
28 ; LINUX-FP: func:
29 ; LINUX-FP-NEXT: {{^}}.L[[BEGIN:.*]]:{{$}}
30 ; LINUX-FP-NEXT: .cfi_startproc
31 ; LINUX-FP-NEXT: {{^}}#
32 ; LINUX-FP-NEXT: stwu 1, -16(1)
33 ; LINUX-FP-NEXT: stw 31, 12(1)
34 ; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}}
35 ; LINUX-FP-NEXT:  .cfi_def_cfa_offset 16
36 ; LINUX-FP-NEXT: {{^}}.L{{.*}}:{{$}}
37 ; LINUX-FP-NEXT: .cfi_offset r31, -4
38 ; LINUX-FP-NEXT: mr 31, 1
39 ; LINUX-FP-NEXT: {{^}}.L[[END:.*]]:{{$}}
40 ; LINUX-FP-NEXT: .size   func, .L[[END]]-.L[[BEGIN]]
41 ; LINUX-FP-NEXT: .cfi_endproc