OSDN Git Service

PR tree-optimization/15262
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / va-arg-11.c
1 /* Test va_arg when the result is ignored and only the pointer increment
2    side effect is used.  */
3 #include <stdarg.h>
4
5 static int
6 foo (int a, ...)
7 {
8   va_list va;
9   int i, res;
10
11   va_start (va, a);
12
13   for (i = 0; i < 4; ++i)
14     (void) va_arg (va, int);
15
16   res = va_arg (va, int);
17
18   va_end (va);
19
20   return res;
21 }
22
23 int
24 main (void)
25 {
26   if (foo (5, 4, 3, 2, 1, 0))
27     abort ();
28   exit (0);
29 }