OSDN Git Service

* expr.c (highest_pow2_factor_for_type): Rename into
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / va-arg-25.c
1 /* Varargs and vectors!  */
2
3 #include <stdarg.h>
4 #include <limits.h>
5
6 #define vector __attribute__((vector_size(16)))
7
8 const vector unsigned int v1 = {10,11,12,13};
9 const vector unsigned int v2 = {20,21,22,23};
10
11 void foo(int a, ...)
12 {
13   va_list args;
14   vector unsigned int v;
15
16   va_start (args, a);
17   v = va_arg (args, vector unsigned int);
18   if (a != 1 || memcmp (&v, &v1, sizeof (v)) != 0)
19     abort ();
20   a = va_arg (args, int);
21   if (a != 2)
22     abort ();
23   v = va_arg (args, vector unsigned int);
24   if (memcmp (&v, &v2, sizeof (v)) != 0)
25     abort ();
26   va_end (args);
27 }
28
29 int main(void)
30 {
31 #if INT_MAX == 2147483647
32   foo (1, (vector unsigned int){10,11,12,13}, 2,
33        (vector unsigned int){20,21,22,23});
34 #endif
35   return 0;
36 }
37