* gcc.c-torture/execute/20101011-1.c: Skip on SH.
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / strct-varg-1.c
blobddd6f05d5acc0f17a2aea6c2719051b7e967c0a3
1 #include <stdarg.h>
3 struct s { int x, y; };
5 f (int attr, ...)
7 struct s va_values;
8 va_list va;
9 int i;
11 va_start (va, attr);
13 if (attr != 2)
14 abort ();
16 va_values = va_arg (va, struct s);
17 if (va_values.x != 0xaaaa || va_values.y != 0x5555)
18 abort ();
20 attr = va_arg (va, int);
21 if (attr != 3)
22 abort ();
24 va_values = va_arg (va, struct s);
25 if (va_values.x != 0xffff || va_values.y != 0x1111)
26 abort ();
28 va_end (va);
31 main ()
33 struct s a, b;
35 a.x = 0xaaaa;
36 a.y = 0x5555;
37 b.x = 0xffff;
38 b.y = 0x1111;
40 f (2, a, 3, b);
41 exit (0);