Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-102.c
blobaf3261d01f8380b56e61e6f4e750e6b1f28fcdfa
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] = {2,3,4,5,6,7,8,9,9};
18 int main1 (int x, int y) {
19 int i;
20 struct extraction *p;
21 p = (struct extraction *) malloc (sizeof (struct extraction));
23 for (i = 0; i < N; i++)
25 p->a[i] = a[i];
26 if (x == 135)
27 abort (); /* to avoid vectorization */
30 /* Not vectorizable: distance 1. */
31 for (i = 0; i < N - 1; i++)
33 *((int *)p + x + i) = *((int *)p + x + i + 1);
36 /* check results: */
37 for (i = 0; i < N; i++)
39 if (p->a[i] != b[i])
40 abort();
42 return 0;
45 int main (void)
47 check_vect ();
49 return main1 (0, N);
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" } } */
54 /* { dg-final { cleanup-tree-dump "vect" } } */