1 /* The purpose of this test is to catch edge cases when arguments are passed
2 in regs and on the stack. We test 16 cases, trying to catch multiple
3 targets (some use 3 regs for argument passing, some use 12, etc.).
4 We test both the arguments and the `lastarg' (the argument to va_start). */
8 extern __SIZE_TYPE__
strlen ();
11 to_hex (unsigned int a
)
13 static char hex
[] = "0123456789abcdef";
21 f0 (char* format
, ...)
25 va_start (ap
, format
);
26 if (strlen (format
) != 16 - 0)
29 if (*format
++ != to_hex (va_arg (ap
, int)))
35 f1 (int a1
, char* format
, ...)
40 if (strlen (format
) != 16 - 1)
43 if (*format
++ != to_hex (va_arg (ap
, int)))
49 f2 (int a1
, int a2
, char* format
, ...)
54 if (strlen (format
) != 16 - 2)
57 if (*format
++ != to_hex (va_arg (ap
, int)))
63 f3 (int a1
, int a2
, int a3
, char* format
, ...)
68 if (strlen (format
) != 16 - 3)
71 if (*format
++ != to_hex (va_arg (ap
, int)))
77 f4 (int a1
, int a2
, int a3
, int a4
, char* format
, ...)
82 if (strlen (format
) != 16 - 4)
85 if (*format
++ != to_hex (va_arg (ap
, int)))
91 f5 (int a1
, int a2
, int a3
, int a4
, int a5
,
97 if (strlen (format
) != 16 - 5)
100 if (*format
++ != to_hex (va_arg (ap
, int)))
106 f6 (int a1
, int a2
, int a3
, int a4
, int a5
,
112 va_start(ap
, format
);
113 if (strlen (format
) != 16 - 6)
116 if (*format
++ != to_hex (va_arg (ap
, int)))
122 f7 (int a1
, int a2
, int a3
, int a4
, int a5
,
128 va_start(ap
, format
);
129 if (strlen (format
) != 16 - 7)
132 if (*format
++ != to_hex (va_arg (ap
, int)))
138 f8 (int a1
, int a2
, int a3
, int a4
, int a5
,
139 int a6
, int a7
, int a8
,
144 va_start(ap
, format
);
145 if (strlen (format
) != 16 - 8)
148 if (*format
++ != to_hex (va_arg (ap
, int)))
154 f9 (int a1
, int a2
, int a3
, int a4
, int a5
,
155 int a6
, int a7
, int a8
, int a9
,
160 va_start(ap
, format
);
161 if (strlen (format
) != 16 - 9)
164 if (*format
++ != to_hex (va_arg (ap
, int)))
170 f10 (int a1
, int a2
, int a3
, int a4
, int a5
,
171 int a6
, int a7
, int a8
, int a9
, int a10
,
176 va_start(ap
, format
);
177 if (strlen (format
) != 16 - 10)
180 if (*format
++ != to_hex (va_arg (ap
, int)))
186 f11 (int a1
, int a2
, int a3
, int a4
, int a5
,
187 int a6
, int a7
, int a8
, int a9
, int a10
,
193 va_start(ap
, format
);
194 if (strlen (format
) != 16 - 11)
197 if (*format
++ != to_hex (va_arg (ap
, int)))
203 f12 (int a1
, int a2
, int a3
, int a4
, int a5
,
204 int a6
, int a7
, int a8
, int a9
, int a10
,
210 va_start(ap
, format
);
211 if (strlen (format
) != 16 - 12)
214 if (*format
++ != to_hex (va_arg (ap
, int)))
220 f13 (int a1
, int a2
, int a3
, int a4
, int a5
,
221 int a6
, int a7
, int a8
, int a9
, int a10
,
222 int a11
, int a12
, int a13
,
227 va_start(ap
, format
);
228 if (strlen (format
) != 16 - 13)
231 if (*format
++ != to_hex (va_arg (ap
, int)))
237 f14 (int a1
, int a2
, int a3
, int a4
, int a5
,
238 int a6
, int a7
, int a8
, int a9
, int a10
,
239 int a11
, int a12
, int a13
, int a14
,
244 va_start(ap
, format
);
245 if (strlen (format
) != 16 - 14)
248 if (*format
++ != to_hex (va_arg (ap
, int)))
254 f15 (int a1
, int a2
, int a3
, int a4
, int a5
,
255 int a6
, int a7
, int a8
, int a9
, int a10
,
256 int a11
, int a12
, int a13
, int a14
, int a15
,
261 va_start(ap
, format
);
262 if (strlen (format
) != 16 - 15)
265 if (*format
++ != to_hex (va_arg (ap
, int)))
272 char *f
= "0123456789abcdef";
274 f0 (f
+0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
275 f1 (0, f
+1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
276 f2 (0, 1, f
+2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
277 f3 (0, 1, 2, f
+3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
278 f4 (0, 1, 2, 3, f
+4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
279 f5 (0, 1, 2, 3, 4, f
+5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
280 f6 (0, 1, 2, 3, 4, 5, f
+6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
281 f7 (0, 1, 2, 3, 4, 5, 6, f
+7, 7, 8, 9, 10, 11, 12, 13, 14, 15);
282 f8 (0, 1, 2, 3, 4, 5, 6, 7, f
+8, 8, 9, 10, 11, 12, 13, 14, 15);
283 f9 (0, 1, 2, 3, 4, 5, 6, 7, 8, f
+9, 9, 10, 11, 12, 13, 14, 15);
284 f10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, f
+10, 10, 11, 12, 13, 14, 15);
285 f11 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, f
+11, 11, 12, 13, 14, 15);
286 f12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, f
+12, 12, 13, 14, 15);
287 f13 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, f
+13, 13, 14, 15);
288 f14 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, f
+14, 14, 15);
289 f15 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, f
+15, 15);