1 /* The purpose of this code is to test argument passing of a tuple of
2 11 integers, with the break point between named and unnamed arguments
3 at every possible position. */
12 verify (const char *tcase
, int n
[11])
15 for (i
= 0; i
<= 10; i
++)
18 printf (" %s: n[%d] = %d expected %d\n", tcase
, i
, n
[i
], i
);
25 #define p(i) int q##i,
26 #define P(i) n[i] = q##i;
50 #define TCASE(x, params, vecinit) \
52 varargs##x (params ...) \
58 va_start (ap, q##x); \
60 for (i = x + 1; i <= 10; i++) \
61 n[i] = va_arg (ap, int); \
64 verify (STR(varargs##x), n); \
67 #define TEST(x) varargs##x (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
70 TCASE(1, p0 p1
, P0 P1
)
71 TCASE(2, p0 p1 p2
, P0 P1 P2
)
72 TCASE(3, p0 p1 p2 p3
, P0 P1 P2 P3
)
73 TCASE(4, p0 p1 p2 p3 p4
, P0 P1 P2 P3 P4
)
74 TCASE(5, p0 p1 p2 p3 p4 p5
, P0 P1 P2 P3 P4 P5
)
75 TCASE(6, p0 p1 p2 p3 p4 p5 p6
, P0 P1 P2 P3 P4 P5 P6
)
76 TCASE(7, p0 p1 p2 p3 p4 p5 p6 p7
, P0 P1 P2 P3 P4 P5 P6 P7
)
77 TCASE(8, p0 p1 p2 p3 p4 p5 p6 p7 p8
, P0 P1 P2 P3 P4 P5 P6 P7 P8
)
78 TCASE(9, p0 p1 p2 p3 p4 p5 p6 p7 p8 p9
, P0 P1 P2 P3 P4 P5 P6 P7 P8 P9
)