2 stdarg-4.c from the execute part of the gcc torture tests.
7 #pragma disable_warning 93 // Using float for double.
11 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
17 x
= va_arg (ap
, double);
18 x
+= va_arg (ap
, long);
19 x
+= va_arg (ap
, double);
35 y
+= va_arg (ap
, long);
36 y
+= va_arg (ap
, double);
50 f3h (int i
, long arg0
, long arg1
, long arg2
, long arg3
)
52 return i
+ arg0
+ arg1
+ arg2
+ arg3
;
58 long t
, arg0
, arg1
, arg2
, arg3
;
65 t
= f3h (i
, 0, 0, 0, 0);
68 arg0
= va_arg (ap
, long);
69 t
= f3h (i
, arg0
, 0, 0, 0);
72 arg0
= va_arg (ap
, long);
73 arg1
= va_arg (ap
, long);
74 t
= f3h (i
, arg0
, arg1
, 0, 0);
77 arg0
= va_arg (ap
, long);
78 arg1
= va_arg (ap
, long);
79 arg2
= va_arg (ap
, long);
80 t
= f3h (i
, arg0
, arg1
, arg2
, 0);
83 arg0
= va_arg (ap
, long);
84 arg1
= va_arg (ap
, long);
85 arg2
= va_arg (ap
, long);
86 arg3
= va_arg (ap
, long);
87 t
= f3h (i
, arg0
, arg1
, arg2
, arg3
);
107 y
= va_arg (ap
, double);
110 y
= va_arg (ap
, double);
111 y
+= va_arg (ap
, double);
122 testTortureExecute (void)
124 #if !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
125 f1 (3, 16.0, 128L, 32.0);
127 f2 (6, 5, 7L, 18.0, 19.0, 17L, 64.0);
128 ASSERT (x
== 100L && y
== 30L);
129 ASSERT (f3 (0) == 0);
130 ASSERT (f3 (1, 18L) == 19L);
131 ASSERT (f3 (2, 18L, 100L) == 120L);
132 ASSERT (f3 (3, 18L, 100L, 300L) == 421L);
133 ASSERT (f3 (4, 18L, 71L, 64L, 86L) == 243L);
134 f4 (4, 6.0, 9.0, 16L, 18.0);
135 ASSERT (x
== 43L && y
== 6L);
136 f4 (5, 7.0, 21.0, 1.0, 17L, 126.0);
138 // Failed on z80 and related before #7265
139 ASSERT (x
== 144L && y
== 28L);