1 /* Test C23 variadic functions with no named parameters, or last named
2 parameter with a declaration not allowed in C17. Execution tests. */
4 /* { dg-options "-O2 -std=c23 -pedantic-errors" } */
9 /* AVR doesn't have that much stack... */
10 struct S
{ int a
[500]; };
12 struct S
{ int a
[1024]; };
21 r
+= va_arg (ap
, int);
32 r
+= va_arg (ap
, int);
33 r
+= va_arg (ap
, int);
44 r
+= va_arg (ap
, int);
45 r
+= va_arg (ap
, int);
46 r
+= va_arg (ap
, int);
57 r
+= va_arg (ap
, int);
58 r
+= va_arg (ap
, int);
59 r
+= va_arg (ap
, int);
60 r
+= va_arg (ap
, int);
71 r
+= va_arg (ap
, int);
72 r
+= va_arg (ap
, int);
73 r
+= va_arg (ap
, int);
74 r
+= va_arg (ap
, int);
75 r
+= va_arg (ap
, int);
86 r
+= va_arg (ap
, int);
87 r
+= va_arg (ap
, int);
88 r
+= va_arg (ap
, int);
89 r
+= va_arg (ap
, int);
90 r
+= va_arg (ap
, int);
91 r
+= va_arg (ap
, int);
102 r
+= va_arg (ap
, int);
103 r
+= va_arg (ap
, int);
104 r
+= va_arg (ap
, int);
105 r
+= va_arg (ap
, int);
106 r
+= va_arg (ap
, int);
107 r
+= va_arg (ap
, int);
108 r
+= va_arg (ap
, int);
119 r
+= va_arg (ap
, int);
120 r
+= va_arg (ap
, int);
121 r
+= va_arg (ap
, int);
122 r
+= va_arg (ap
, int);
123 r
+= va_arg (ap
, int);
124 r
+= va_arg (ap
, int);
125 r
+= va_arg (ap
, int);
126 r
+= va_arg (ap
, int);
137 r
+= va_arg (ap
, int);
150 r
+= va_arg (ap
, int);
151 r
+= va_arg (ap
, int);
164 r
+= va_arg (ap
, int);
165 r
+= va_arg (ap
, int);
166 r
+= va_arg (ap
, int);
179 r
+= va_arg (ap
, int);
180 r
+= va_arg (ap
, int);
181 r
+= va_arg (ap
, int);
182 r
+= va_arg (ap
, int);
195 r
+= va_arg (ap
, int);
196 r
+= va_arg (ap
, int);
197 r
+= va_arg (ap
, int);
198 r
+= va_arg (ap
, int);
199 r
+= va_arg (ap
, int);
212 r
+= va_arg (ap
, int);
213 r
+= va_arg (ap
, int);
214 r
+= va_arg (ap
, int);
215 r
+= va_arg (ap
, int);
216 r
+= va_arg (ap
, int);
217 r
+= va_arg (ap
, int);
230 r
+= va_arg (ap
, int);
231 r
+= va_arg (ap
, int);
232 r
+= va_arg (ap
, int);
233 r
+= va_arg (ap
, int);
234 r
+= va_arg (ap
, int);
235 r
+= va_arg (ap
, int);
236 r
+= va_arg (ap
, int);
249 r
+= va_arg (ap
, int);
250 r
+= va_arg (ap
, int);
251 r
+= va_arg (ap
, int);
252 r
+= va_arg (ap
, int);
253 r
+= va_arg (ap
, int);
254 r
+= va_arg (ap
, int);
255 r
+= va_arg (ap
, int);
256 r
+= va_arg (ap
, int);
266 return f8 (1, 2, 3, 4, 5, 6, 7, 8);
272 return s8 (1, 2, 3, 4, 5, 6, 7, 8).a
[0];
278 if (f1 (1) != 1 || f2 (1, 2) != 3 || f3 (1, 2, 3) != 6
279 || f4 (1, 2, 3, 4) != 10 || f5 (1, 2, 3, 4, 5) != 15
280 || f6 (1, 2, 3, 4, 5, 6) != 21 || f7 (1, 2, 3, 4, 5, 6, 7) != 28
281 || f8 (1, 2, 3, 4, 5, 6, 7, 8) != 36)
283 if (s1 (1).a
[0] != 1 || s2 (1, 2).a
[0] != 3 || s3 (1, 2, 3).a
[0] != 6
284 || s4 (1, 2, 3, 4).a
[0] != 10 || s5 (1, 2, 3, 4, 5).a
[0] != 15
285 || s6 (1, 2, 3, 4, 5, 6).a
[0] != 21
286 || s7 (1, 2, 3, 4, 5, 6, 7).a
[0] != 28
287 || s8 (1, 2, 3, 4, 5, 6, 7, 8).a
[0] != 36)