2 va-arg-10.c from the execute part of the gcc torture tests.
10 #pragma disable_warning 85
11 #pragma disable_warning 196
14 /* This is a modfied version of va-arg-9.c to test va_copy. */
19 #define va_copy __va_copy
22 extern size_t strlen (const char *);
25 to_hex (unsigned int a
)
27 static char hex
[] = "0123456789abcdef";
35 fap (int i
, char* format
, va_list ap
)
43 if (strlen (format
) != 16 - i
)
46 if (*format
++ != to_hex (va_arg (ap
, int)))
49 if (*formatc
++ != to_hex (va_arg (apc
, int)))
54 f0 (char* format
, ...)
58 va_start (ap
, format
);
64 f1 (int a1
, char* format
, ...)
74 f2 (int a1
, int a2
, char* format
, ...)
84 f3 (int a1
, int a2
, int a3
, char* format
, ...)
94 f4 (int a1
, int a2
, int a3
, int a4
, char* format
, ...)
104 f5 (int a1
, int a2
, int a3
, int a4
, int a5
,
109 va_start(ap
, format
);
115 f6 (int a1
, int a2
, int a3
, int a4
, int a5
,
121 va_start(ap
, format
);
127 f7 (int a1
, int a2
, int a3
, int a4
, int a5
,
133 va_start(ap
, format
);
139 f8 (int a1
, int a2
, int a3
, int a4
, int a5
,
140 int a6
, int a7
, int a8
,
145 va_start(ap
, format
);
151 f9 (int a1
, int a2
, int a3
, int a4
, int a5
,
152 int a6
, int a7
, int a8
, int a9
,
157 va_start(ap
, format
);
163 f10 (int a1
, int a2
, int a3
, int a4
, int a5
,
164 int a6
, int a7
, int a8
, int a9
, int a10
,
169 va_start(ap
, format
);
175 f11 (int a1
, int a2
, int a3
, int a4
, int a5
,
176 int a6
, int a7
, int a8
, int a9
, int a10
,
182 va_start(ap
, format
);
188 f12 (int a1
, int a2
, int a3
, int a4
, int a5
,
189 int a6
, int a7
, int a8
, int a9
, int a10
,
195 va_start(ap
, format
);
201 f13 (int a1
, int a2
, int a3
, int a4
, int a5
,
202 int a6
, int a7
, int a8
, int a9
, int a10
,
203 int a11
, int a12
, int a13
,
208 va_start(ap
, format
);
214 f14 (int a1
, int a2
, int a3
, int a4
, int a5
,
215 int a6
, int a7
, int a8
, int a9
, int a10
,
216 int a11
, int a12
, int a13
, int a14
,
221 va_start(ap
, format
);
227 f15 (int a1
, int a2
, int a3
, int a4
, int a5
,
228 int a6
, int a7
, int a8
, int a9
, int a10
,
229 int a11
, int a12
, int a13
, int a14
, int a15
,
234 va_start(ap
, format
);
240 testTortureExecute (void)
242 #if !defined(__SDCC_pdk14) // Lack of memory
243 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
244 char *f
= "0123456789abcdef";
246 f0 (f
+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
247 f1 (0, f
+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
248 f2 (0, 1, f
+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
249 f3 (0, 1, 2, f
+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
250 f4 (0, 1, 2, 3, f
+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
251 f5 (0, 1, 2, 3, 4, f
+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
252 f6 (0, 1, 2, 3, 4, 5, f
+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
253 f7 (0, 1, 2, 3, 4, 5, 6, f
+7, 7, 8, 9, 10, 11, 12, 13, 14, 15);
254 f8 (0, 1, 2, 3, 4, 5, 6, 7, f
+8, 8, 9, 10, 11, 12, 13, 14, 15);
255 f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f
+9, 9, 10, 11, 12, 13, 14, 15);
256 f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f
+10, 10, 11, 12, 13, 14, 15);
257 f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f
+11, 11, 12, 13, 14, 15);
258 f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f
+12, 12, 13, 14, 15);
259 f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f
+13, 13, 14, 15);
260 f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f
+14, 14, 15);
261 f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f
+15, 15);