1 /*
2 va-arg-1.c from the execute part of the gcc torture tests.
3 */
4 
5 #include <testfwk.h>
6 
7 #pragma disable_warning 85
8 
9 #include <stdarg.h>
10 
11 typedef unsigned long L;
f(L p0,L p1,L p2,L p3,L p4,L p5,L p6,L p7,L p8,...)12 f (L p0, L p1, L p2, L p3, L p4, L p5, L p6, L p7, L p8, ...)
13 {
14   va_list select;
15 
16   va_start (select, p8);
17 
18   if (va_arg (select, L) != 10)
19     ASSERT (0);
20   if (va_arg (select, L) != 11)
21     ASSERT (0);
22   if (va_arg (select, L) != 0)
23     ASSERT (0);
24 
25   va_end (select);
26 }
27 
28 void
testTortureExecute(void)29 testTortureExecute (void)
30 {
31 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
32   f (1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 0L);
33   return;
34 #endif
35 }
36