2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 931004-8.c
blob5fb97f64a6b1fb25d60dd6ef394fb165ae875bcf
1 #include <stdarg.h>
3 struct tiny
5 char c;
6 };
8 f (int n, ...)
10 struct tiny x;
11 int i;
13 va_list ap;
14 va_start (ap,n);
15 for (i = 0; i < n; i++)
17 x = va_arg (ap,struct tiny);
18 if (x.c != i + 10)
19 abort();
22 long x = va_arg (ap, long);
23 if (x != 123)
24 abort();
26 va_end (ap);
29 main ()
31 struct tiny x[3];
32 x[0].c = 10;
33 x[1].c = 11;
34 x[2].c = 12;
35 f (3, x[0], x[1], x[2], (long) 123);
36 exit(0);