Pete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl...
[oota-llvm.git] / test / CodeGen / PowerPC / empty-functions.ll
1 ; RUN: llc < %s -mtriple=powerpc-apple-darwin | FileCheck -check-prefix=CHECK-MACHO %s
2 ; RUN: llc < %s -mtriple=powerpc-apple-darwin -disable-fp-elim | FileCheck -check-prefix=CHECK-MACHO %s
3 ; RUN: llc < %s -mtriple=powerpc-linux-gnu | FileCheck -check-prefix=LINUX-NO-FP %s
4 ; RUN: llc < %s -mtriple=powerpc-linux-gnu -disable-fp-elim | FileCheck -check-prefix=LINUX-FP %s
5
6 define void @func() {
7 entry:
8   unreachable
9 }
10
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
17
18 ; An empty function is perfectly fine on ELF.
19 ; LINUX-NO-FP: func:
20 ; LINUX-NO-FP-NEXT: .cfi_startproc
21 ; LINUX-NO-FP-NEXT: {{^}}#
22 ; LINUX-NO-FP-NEXT: {{^}}.L{{.*}}:{{$}}
23 ; LINUX-NO-FP-NEXT: .size   func, .L{{.*}}-func
24 ; LINUX-NO-FP-NEXT: .cfi_endproc
25
26 ; A cfi directive can point to the end of a function. It (and in fact the
27 ; entire body) could be optimized out because of the unreachable, but we
28 ; don't do it right now.
29 ; LINUX-FP: func:
30 ; LINUX-FP-NEXT: .cfi_startproc
31 ; LINUX-FP-NEXT: {{^}}#
32 ; LINUX-FP-NEXT: stw 31, -4(1)
33 ; LINUX-FP-NEXT: stwu 1, -16(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{{.*}}:{{$}}
40 ; LINUX-FP-NEXT: .cfi_def_cfa_register r31
41 ; LINUX-FP-NEXT:{{^}}.L{{.*}}:{{$}}
42 ; LINUX-FP-NEXT: .size   func, .Ltmp3-func
43 ; LINUX-FP-NEXT: .cfi_endproc