Merge to HEAD at tree-cleanup-merge-20041024 .
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / va-arg-24.c
blobc8fdaf0f95cde1e6d8ec25a99d1f66f185f6fe59
1 /* Varargs and vectors! */
3 #include <stdarg.h>
5 #define vector __attribute__((vector_size(16)))
7 const vector unsigned int v1 = {10,11,12,13};
8 const vector unsigned int v2 = {20,21,22,23};
10 void foo(int a, ...)
12 va_list args;
13 vector unsigned int v;
15 va_start (args, a);
16 v = va_arg (args, vector unsigned int);
17 if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
18 abort ();
19 a = va_arg (args, int);
20 if (a != 2)
21 abort ();
22 v = va_arg (args, vector unsigned int);
23 if (memcmp (&v, &v2, sizeof (v) != 0))
24 abort ();
25 va_end (args);
28 int main(void)
30 foo (1, (vector unsigned int){10,11,12,13}, 2,
31 (vector unsigned int){14,15,16,17});
32 return 0;