1; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | \
2; RUN: FileCheck %s -check-prefix=PPC32-LINUX-NOFP
3
4; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu \
5; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC32-LINUX-FP
6
7; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | \
8; RUN: FileCheck %s -check-prefix=PPC64-NOFP
9
10; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
11; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC64-FP
12
13; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
14; RUN: -mtriple=powerpc-ibm-aix-xcoff | FileCheck %s -check-prefix=PPC32-AIX-NOFP
15
16; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
17; RUN: -mtriple=powerpc-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
18; RUN: -check-prefix=PPC32-AIX-FP
19
20; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
21; RUN: -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s -check-prefix=PPC64-NOFP
22
23; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
24; RUN: -mtriple=powerpc64-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
25; RUN: -check-prefix=PPC64-FP
26
27; - PPC64 SVR4ABI and AIX ABI:
28;   288 bytes = 18*8 (FPRs) + 18*8 (GPRs, GPR13 reserved);
29; - PPC32 SVR4ABI has no red zone;
30; - PPC32 AIX ABI:
31;   220 bytes = 18*8 (FPRs) + 19*4 (GPRs);
32
33define i32* @in_stack_floor_32() {
34        %tmp = alloca i32, i32 55
35        ret i32* %tmp
36}
37
38define i32* @out_stack_floor_32() {
39        %tmp = alloca i32, i32 56
40        ret i32* %tmp
41}
42
43define i32* @in_stack_floor_64() {
44        %tmp = alloca i32, i32 72
45        ret i32* %tmp
46}
47
48define i32* @out_stack_floor_64() {
49        %tmp = alloca i32, i32 73
50        ret i32* %tmp
51}
52
53; PPC32-LINUX-NOFP-LABEL: in_stack_floor_32
54; PPC32-LINUX-NOFP: stwu
55
56; PPC32-LINUX-NOFP-LABEL: out_stack_floor_32
57; PPC32-LINUX-NOFP: stwu
58
59; PPC32-LINUX-FP-LABEL: in_stack_floor_32
60; PPC32-LINUX-FP: stwu
61
62; PPC32-LINUX-FP-LABEL: out_stack_floor_32
63; PPC32-LINUX-FP: stwu
64
65; PPC32-AIX-NOFP-LABEL: in_stack_floor_32
66; PPC32-AIX-NOFP-NOT: stwu
67
68; PPC32-AIX-NOFP-LABEL: out_stack_floor_32
69; PPC32-AIX-NOFP:      stwu 1, -256(1)
70
71; PPC32-AIX-FP-LABEL: in_stack_floor_32
72; PPC32-AIX-FP: stwu 1, -256(1)
73
74; PPC32-AIX-FP-LABEL: out_stack_floor_32
75; PPC32-AIX-FP: stwu 1, -256(1)
76
77; PPC64-NOFP-LABEL: in_stack_floor_64
78; PPC64-NOFP:      addi 3, 1, -288
79
80; PPC64-NOFP-LABEL: out_stack_floor_64
81; PPC64-NOFP:      stdu 1, -352(1)
82
83; PPC64-FP-LABEL: in_stack_floor_64
84; PPC64-FP: stdu 1, -352(1)
85
86; PPC64-FP-LABEL: out_stack_floor_64
87; PPC64-FP: stdu 1, -352(1)
88