Merged with mainline at revision 126347.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-101.c
blobe195a58af5f85de78460762330021406ca3ad6a3
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,0};
18 int main1 (int x, int y) {
19 int i;
20 struct extraction *p;
21 p = (struct extraction *) malloc (sizeof (struct extraction));
23 /* Not vectorizable: different unknown offset. */
24 for (i = 0; i < N; i++)
26 *((int *)p + x + i) = a[i];
27 *((int *)p + y + i) = b[i];
30 /* check results: */
31 for (i = 0; i < N; i++)
33 if (p->a[i] != a[i] || p->b[i] != b[i])
34 abort();
36 return 0;
39 int main (void)
41 check_vect ();
43 return main1 (0, N);
46 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
47 /* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" } } */
48 /* { dg-final { cleanup-tree-dump "vect" } } */