PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / vector-init-2.c
blob6527f495d81628431eac4de264d01b1867b4ee78
1 /* { dg-do run } */
3 /* PR C/31499, test that the C front-end treats vectors like an array
4 and that it works at runtime. */
6 #define vector __attribute__((__vector_size__(4*sizeof(int)) ))
7 vector signed int v1[]={0,1,2,3,4,5,6,7};
10 int main(void)
12 int i;
13 for (i = 0; i < sizeof(v1)/sizeof(v1[0]); i++)
15 vector int t = v1[i];
16 int *d = (int*)&t;
17 int j;
18 for (j = 0; j < 4; j++)
20 if (d[j] != i * 4 + j)
21 __builtin_abort ();
24 return 0;