2 stdarg-4.c from the execute part of the gcc torture tests.
12 #pragma disable_warning 93 // Using float for double.
18 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Bug #2874
20 #define INLINED_{inlined}
28 x
= va_arg (ap
, double);
29 x
+= va_arg (ap
, long);
30 x
+= va_arg (ap
, double);
49 y
+= va_arg (ap
, long);
50 y
+= va_arg (ap
, double);
64 f3h (int i
, long arg0
, long arg1
, long arg2
, long arg3
)
66 return i
+ arg0
+ arg1
+ arg2
+ arg3
;
72 long t
, arg0
, arg1
, arg2
, arg3
;
79 t
= f3h (i
, 0, 0, 0, 0);
82 arg0
= va_arg (ap
, long);
83 t
= f3h (i
, arg0
, 0, 0, 0);
86 arg0
= va_arg (ap
, long);
87 arg1
= va_arg (ap
, long);
88 t
= f3h (i
, arg0
, arg1
, 0, 0);
91 arg0
= va_arg (ap
, long);
92 arg1
= va_arg (ap
, long);
93 arg2
= va_arg (ap
, long);
94 t
= f3h (i
, arg0
, arg1
, arg2
, 0);
97 arg0
= va_arg (ap
, long);
98 arg1
= va_arg (ap
, long);
99 arg2
= va_arg (ap
, long);
100 arg3
= va_arg (ap
, long);
101 t
= f3h (i
, arg0
, arg1
, arg2
, arg3
);
121 y
= va_arg (ap
, double);
124 y
= va_arg (ap
, double);
125 y
+= va_arg (ap
, double);
136 testTortureExecute (void)
138 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Bug #2874
139 #if defined(__SDCC_pic16)
141 #elif defined(__SDCC_mcs51) && defined(__SDCC_STACK_AUTO) && !defined(__SDCC_USE_XSTACK) && defined(INLINED_yes)
144 f1 (3, 16.0, 128L, 32.0);
146 f2 (6, 5, 7L, 18.0, 19.0, 17L, 64.0);
149 ASSERT (f3 (0) == 0);
150 ASSERT (f3 (1, 18L) == 19L);
151 ASSERT (f3 (2, 18L, 100L) == 120L);
152 ASSERT (f3 (3, 18L, 100L, 300L) == 421L);
153 ASSERT (f3 (4, 18L, 71L, 64L, 86L) == 243L);
154 f4 (4, 6.0, 9.0, 16L, 18.0);
157 f4 (5, 7.0, 21.0, 1.0, 17L, 126.0);
159 // Failed on z80 and related