1 |
12 |
jlechner |
/* First dg-final line after each function is for architectures that use
|
2 |
|
|
a struct {...} va_list[1] with separate GPR and FPR counters in the
|
3 |
|
|
structure. Second dg-final line is for architectures that use void *
|
4 |
|
|
or char * va_list. */
|
5 |
|
|
/* { dg-do compile } */
|
6 |
|
|
/* { dg-options "-O2 -fdump-tree-stdarg" } */
|
7 |
|
|
|
8 |
|
|
#include <stdarg.h>
|
9 |
|
|
|
10 |
|
|
extern void foo (int, va_list);
|
11 |
|
|
extern void bar (int);
|
12 |
|
|
long x;
|
13 |
|
|
double d;
|
14 |
|
|
va_list gap;
|
15 |
|
|
va_list *pap;
|
16 |
|
|
|
17 |
|
|
void
|
18 |
|
|
f1 (int i, ...)
|
19 |
|
|
{
|
20 |
|
|
va_list ap;
|
21 |
|
|
va_start (ap, i);
|
22 |
|
|
va_end (ap);
|
23 |
|
|
}
|
24 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
25 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
26 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
27 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
28 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
29 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target ia64-*-* } } } */
|
30 |
|
|
/* { dg-final { scan-tree-dump "f1: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
31 |
|
|
|
32 |
|
|
void
|
33 |
|
|
f2 (int i, ...)
|
34 |
|
|
{
|
35 |
|
|
va_list ap;
|
36 |
|
|
va_start (ap, i);
|
37 |
|
|
bar (d);
|
38 |
|
|
x = va_arg (ap, long);
|
39 |
|
|
bar (x);
|
40 |
|
|
va_end (ap);
|
41 |
|
|
}
|
42 |
|
|
/* Assume the counters can be number of registers or bytes on 32-bit
|
43 |
|
|
architecture or bytes on 64-bit architecture. */
|
44 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
45 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
46 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 8 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
|
47 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save 1 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
48 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
49 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target ia64-*-* } } } */
|
50 |
|
|
/* { dg-final { scan-tree-dump "f2: va_list escapes 0, needs to save \[148\] GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
51 |
|
|
|
52 |
|
|
void
|
53 |
|
|
f3 (int i, ...)
|
54 |
|
|
{
|
55 |
|
|
va_list ap;
|
56 |
|
|
va_start (ap, i);
|
57 |
|
|
d = va_arg (ap, double);
|
58 |
|
|
va_end (ap);
|
59 |
|
|
}
|
60 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
61 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
62 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 0 GPR units and 1 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
63 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save 8 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
|
64 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
65 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
|
66 |
|
|
/* { dg-final { scan-tree-dump "f3: va_list escapes 0, needs to save \[1-9\]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
67 |
|
|
|
68 |
|
|
void
|
69 |
|
|
f4 (int i, ...)
|
70 |
|
|
{
|
71 |
|
|
va_list ap;
|
72 |
|
|
va_start (ap, i);
|
73 |
|
|
x = va_arg (ap, double);
|
74 |
|
|
foo (i, ap);
|
75 |
|
|
va_end (ap);
|
76 |
|
|
}
|
77 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
78 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
79 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
80 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
81 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
82 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
83 |
|
|
/* { dg-final { scan-tree-dump "f4: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
84 |
|
|
|
85 |
|
|
void
|
86 |
|
|
f5 (int i, ...)
|
87 |
|
|
{
|
88 |
|
|
va_list ap;
|
89 |
|
|
va_start (ap, i);
|
90 |
|
|
va_copy (gap, ap);
|
91 |
|
|
bar (i);
|
92 |
|
|
va_end (ap);
|
93 |
|
|
va_end (gap);
|
94 |
|
|
}
|
95 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
96 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
97 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
98 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
99 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
100 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
101 |
|
|
/* { dg-final { scan-tree-dump "f5: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
102 |
|
|
|
103 |
|
|
void
|
104 |
|
|
f6 (int i, ...)
|
105 |
|
|
{
|
106 |
|
|
va_list ap;
|
107 |
|
|
va_start (ap, i);
|
108 |
|
|
bar (d);
|
109 |
|
|
va_arg (ap, long);
|
110 |
|
|
va_arg (ap, long);
|
111 |
|
|
x = va_arg (ap, long);
|
112 |
|
|
bar (x);
|
113 |
|
|
va_end (ap);
|
114 |
|
|
}
|
115 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
116 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
117 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 24 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
|
118 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save 3 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
119 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
120 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target ia64-*-* } } } */
|
121 |
|
|
/* { dg-final { scan-tree-dump "f6: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
122 |
|
|
|
123 |
|
|
void
|
124 |
|
|
f7 (int i, ...)
|
125 |
|
|
{
|
126 |
|
|
va_list ap;
|
127 |
|
|
va_start (ap, i);
|
128 |
|
|
pap = ≈
|
129 |
|
|
bar (6);
|
130 |
|
|
va_end (ap);
|
131 |
|
|
}
|
132 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
133 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
134 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
135 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
136 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
137 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
138 |
|
|
/* { dg-final { scan-tree-dump "f7: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
139 |
|
|
|
140 |
|
|
void
|
141 |
|
|
f8 (int i, ...)
|
142 |
|
|
{
|
143 |
|
|
va_list ap;
|
144 |
|
|
va_start (ap, i);
|
145 |
|
|
pap = ≈
|
146 |
|
|
bar (d);
|
147 |
|
|
x = va_arg (ap, long);
|
148 |
|
|
bar (x);
|
149 |
|
|
va_end (ap);
|
150 |
|
|
}
|
151 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
152 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
153 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
154 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
155 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
156 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
157 |
|
|
/* { dg-final { scan-tree-dump "f8: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
158 |
|
|
|
159 |
|
|
void
|
160 |
|
|
f9 (int i, ...)
|
161 |
|
|
{
|
162 |
|
|
va_list ap;
|
163 |
|
|
va_start (ap, i);
|
164 |
|
|
__asm __volatile ("" : "=r" (pap) : "0" (&ap));
|
165 |
|
|
bar (6);
|
166 |
|
|
va_end (ap);
|
167 |
|
|
}
|
168 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
169 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
170 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
171 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
172 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
173 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
174 |
|
|
/* { dg-final { scan-tree-dump "f9: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
175 |
|
|
|
176 |
|
|
void
|
177 |
|
|
f10 (int i, ...)
|
178 |
|
|
{
|
179 |
|
|
va_list ap;
|
180 |
|
|
va_start (ap, i);
|
181 |
|
|
__asm __volatile ("" : "=r" (pap) : "0" (&ap));
|
182 |
|
|
bar (d);
|
183 |
|
|
x = va_arg (ap, long);
|
184 |
|
|
bar (x);
|
185 |
|
|
va_end (ap);
|
186 |
|
|
}
|
187 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
188 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
189 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
190 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target s390*-*-linux* } } } */
|
191 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
192 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target ia64-*-* } } } */
|
193 |
|
|
/* { dg-final { scan-tree-dump "f10: va_list escapes 1, needs to save all GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
194 |
|
|
|
195 |
|
|
void
|
196 |
|
|
f11 (int i, ...)
|
197 |
|
|
{
|
198 |
|
|
va_list ap;
|
199 |
|
|
va_start (ap, i);
|
200 |
|
|
bar (d);
|
201 |
|
|
x = va_arg (ap, long);
|
202 |
|
|
x += va_arg (ap, long);
|
203 |
|
|
x += va_arg (ap, long);
|
204 |
|
|
bar (x);
|
205 |
|
|
va_end (ap);
|
206 |
|
|
}
|
207 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
208 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units and 0 FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
209 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save 24 GPR units and 1" "stdarg" { target alpha*-*-linux* } } } */
|
210 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save 3 GPR units and 0 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
211 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
212 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target ia64-*-* } } } */
|
213 |
|
|
/* { dg-final { scan-tree-dump "f11: va_list escapes 0, needs to save (3|12|24) GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
214 |
|
|
|
215 |
|
|
void
|
216 |
|
|
f12 (int i, ...)
|
217 |
|
|
{
|
218 |
|
|
va_list ap;
|
219 |
|
|
va_start (ap, i);
|
220 |
|
|
bar (d);
|
221 |
|
|
va_arg (ap, double);
|
222 |
|
|
va_arg (ap, double);
|
223 |
|
|
x = va_arg (ap, double);
|
224 |
|
|
bar (x);
|
225 |
|
|
va_end (ap);
|
226 |
|
|
}
|
227 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
228 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
229 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 24 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
|
230 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save 0 GPR units and 3 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
231 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
232 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
|
233 |
|
|
/* { dg-final { scan-tree-dump "f12: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
234 |
|
|
|
235 |
|
|
void
|
236 |
|
|
f13 (int i, ...)
|
237 |
|
|
{
|
238 |
|
|
va_list ap;
|
239 |
|
|
va_start (ap, i);
|
240 |
|
|
bar (d);
|
241 |
|
|
x = va_arg (ap, double);
|
242 |
|
|
x += va_arg (ap, double);
|
243 |
|
|
x += va_arg (ap, double);
|
244 |
|
|
bar (x);
|
245 |
|
|
va_end (ap);
|
246 |
|
|
}
|
247 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
248 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
249 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 24 GPR units and 2" "stdarg" { target alpha*-*-linux* } } } */
|
250 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save 0 GPR units and 3 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
251 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
252 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
|
253 |
|
|
/* { dg-final { scan-tree-dump "f13: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
254 |
|
|
|
255 |
|
|
void
|
256 |
|
|
f14 (int i, ...)
|
257 |
|
|
{
|
258 |
|
|
va_list ap;
|
259 |
|
|
va_start (ap, i);
|
260 |
|
|
bar (d);
|
261 |
|
|
x = va_arg (ap, double);
|
262 |
|
|
x += va_arg (ap, long);
|
263 |
|
|
x += va_arg (ap, double);
|
264 |
|
|
bar (x);
|
265 |
|
|
va_end (ap);
|
266 |
|
|
}
|
267 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
268 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
269 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save 24 GPR units and 3" "stdarg" { target alpha*-*-linux* } } } */
|
270 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save 1 GPR units and 2 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
271 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
272 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target ia64-*-* } } } */
|
273 |
|
|
/* { dg-final { scan-tree-dump "f14: va_list escapes 0, needs to save \[1-9]\[0-9\]* GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
274 |
|
|
|
275 |
|
|
inline void __attribute__((always_inline))
|
276 |
|
|
f15_1 (va_list ap)
|
277 |
|
|
{
|
278 |
|
|
x = va_arg (ap, double);
|
279 |
|
|
x += va_arg (ap, long);
|
280 |
|
|
x += va_arg (ap, double);
|
281 |
|
|
}
|
282 |
|
|
|
283 |
|
|
void
|
284 |
|
|
f15 (int i, ...)
|
285 |
|
|
{
|
286 |
|
|
va_list ap;
|
287 |
|
|
va_start (ap, i);
|
288 |
|
|
f15_1 (ap);
|
289 |
|
|
va_end (ap);
|
290 |
|
|
}
|
291 |
|
|
/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && lp64 } } } } */
|
292 |
|
|
/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save \[148\] GPR units and \[1-9\]\[0-9\]* FPR units" "stdarg" { target { powerpc*-*-linux* && ilp32 } } } } */
|
293 |
|
|
/* { dg-final { scan-tree-dump "f15: va_list escapes 1, needs to save all GPR units and all FPR units" "stdarg" { target alpha*-*-linux* } } } */
|
294 |
|
|
/* { dg-final { scan-tree-dump "f15: va_list escapes 0, needs to save 1 GPR units and 2 FPR units" "stdarg" { target s390*-*-linux* } } } */
|
295 |
|
|
/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } } */
|
296 |
|
|
/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target ia64-*-* } } } */
|
297 |
|
|
/* { dg-final { scan-tree-dump-not "f15: va_list escapes 0, needs to save 0 GPR units" "stdarg" { target { powerpc*-*-* && lp64 } } } } */
|
298 |
|
|
/* { dg-final { cleanup-tree-dump "stdarg" } } */
|