Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / no-vfa-vect-102a.c
blobda8afaa1a7d4c4c49486ddba57329720eff51c9d
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};
17 volatile int foo;
19 __attribute__ ((noinline))
20 int main1 (int x, int y) {
21 int i;
22 struct extraction *p;
23 p = (struct extraction *) malloc (sizeof (struct extraction));
25 for (i = 0; i < N; i++)
27 p->a[i] = a[i];
28 if (foo == 135)
29 abort (); /* to avoid vectorization */
32 /* Not vectorizable: distance 1. */
33 for (i = 0; i < N - 1; i++)
35 p->a[x + i + 1] = p->a[x + i];
38 /* check results: */
39 for (i = 0; i < N; i++)
41 if (p->a[i] != 1)
42 abort();
44 return 0;
47 int main (void)
49 check_vect ();
51 foo = 0;
52 return main1 (0, N);
55 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
56 /* { dg-final { scan-tree-dump-times "possible dependence between data-refs" 1 "vect" } } */
57 /* { dg-final { cleanup-tree-dump "vect" } } */