Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-103.c
blob108f56d378c590338942fe5009f4cf3b54079f31
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 9
9 struct extraction
11 int a[N];
12 int b[N];
15 static int a[N] = {1,2,3,4,5,6,7,8,9};
16 static int b[N] = {17,24,7,0,2,3,4,31,82};
17 static int c[N] = {9,17,24,7,0,2,3,4,31};
18 volatile int foo;
20 __attribute__ ((noinline))
21 int main1 (int x, int y) {
22 int i;
23 struct extraction *p;
24 p = (struct extraction *) malloc (sizeof (struct extraction));
26 for (i = 0; i < N; i++)
28 p->a[i] = a[i];
29 p->b[i] = b[i];
30 if (foo == 135)
31 abort (); /* to avoid vectorization */
34 /* Vectorizable: distance > VF. */
35 for (i = 0; i < N; i++)
37 *((int *)p + x + i) = *((int *)p + x + i + 8);
40 /* check results: */
41 for (i = 0; i < N; i++)
43 if (p->a[i] != c[i])
44 abort();
46 return 0;
49 int main (void)
51 check_vect ();
53 foo = 0;
54 return main1 (0, N);
57 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
58 /* { dg-final { scan-tree-dump-times "dependence distance modulo vf == 0" 1 "vect" } } */
59 /* { dg-final { cleanup-tree-dump "vect" } } */