2 va-arg-9.c from the execute part of the gcc torture tests.
8 #pragma disable_warning 85
9 #pragma disable_warning 196
14 /* This is a modfied version of va-arg-2.c to test passing a va_list as
15 a parameter to another function. */
19 extern size_t strlen (const char *);
22 to_hex (unsigned int a
)
24 static char hex
[] = "0123456789abcdef";
32 fap (int i
, char* format
, va_list ap
)
34 if (strlen (format
) != 16 - i
)
37 if (*format
++ != to_hex (va_arg (ap
, int)))
42 f0 (char* format
, ...)
46 va_start (ap
, format
);
52 f1 (int a1
, char* format
, ...)
61 #if !defined(__SDCC_pdk14) // Lack of memory
63 f2 (int a1
, int a2
, char* format
, ...)
73 f3 (int a1
, int a2
, int a3
, char* format
, ...)
83 f4 (int a1
, int a2
, int a3
, int a4
, char* format
, ...)
93 f5 (int a1
, int a2
, int a3
, int a4
, int a5
,
104 f6 (int a1
, int a2
, int a3
, int a4
, int a5
,
110 va_start(ap
, format
);
116 f7 (int a1
, int a2
, int a3
, int a4
, int a5
,
122 va_start(ap
, format
);
128 f8 (int a1
, int a2
, int a3
, int a4
, int a5
,
129 int a6
, int a7
, int a8
,
134 va_start(ap
, format
);
140 f9 (int a1
, int a2
, int a3
, int a4
, int a5
,
141 int a6
, int a7
, int a8
, int a9
,
146 va_start(ap
, format
);
152 f10 (int a1
, int a2
, int a3
, int a4
, int a5
,
153 int a6
, int a7
, int a8
, int a9
, int a10
,
158 va_start(ap
, format
);
164 f11 (int a1
, int a2
, int a3
, int a4
, int a5
,
165 int a6
, int a7
, int a8
, int a9
, int a10
,
171 va_start(ap
, format
);
177 f12 (int a1
, int a2
, int a3
, int a4
, int a5
,
178 int a6
, int a7
, int a8
, int a9
, int a10
,
184 va_start(ap
, format
);
190 f13 (int a1
, int a2
, int a3
, int a4
, int a5
,
191 int a6
, int a7
, int a8
, int a9
, int a10
,
192 int a11
, int a12
, int a13
,
197 va_start(ap
, format
);
203 f14 (int a1
, int a2
, int a3
, int a4
, int a5
,
204 int a6
, int a7
, int a8
, int a9
, int a10
,
205 int a11
, int a12
, int a13
, int a14
,
210 va_start(ap
, format
);
216 f15 (int a1
, int a2
, int a3
, int a4
, int a5
,
217 int a6
, int a7
, int a8
, int a9
, int a10
,
218 int a11
, int a12
, int a13
, int a14
, int a15
,
223 va_start(ap
, format
);
230 testTortureExecute (void)
232 #if !defined(__SDCC_pdk14) // Lack of memory
233 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
234 char *f
= "0123456789abcdef";
236 f0 (f
+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
237 f1 (0, f
+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
238 f2 (0, 1, f
+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
239 f3 (0, 1, 2, f
+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
240 f4 (0, 1, 2, 3, f
+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
241 f5 (0, 1, 2, 3, 4, f
+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
242 f6 (0, 1, 2, 3, 4, 5, f
+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
243 f7 (0, 1, 2, 3, 4, 5, 6, f
+7, 7, 8, 9, 10, 11, 12, 13, 14, 15);
244 f8 (0, 1, 2, 3, 4, 5, 6, 7, f
+8, 8, 9, 10, 11, 12, 13, 14, 15);
245 f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f
+9, 9, 10, 11, 12, 13, 14, 15);
246 f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f
+10, 10, 11, 12, 13, 14, 15);
247 f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f
+11, 11, 12, 13, 14, 15);
248 f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f
+12, 12, 13, 14, 15);
249 f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f
+13, 13, 14, 15);
250 f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f
+14, 14, 15);
251 f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f
+15, 15);