Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-97-big-array.c
blob3210086033474b6e2b6b581e90b4b023fb618e9a
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
9 char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
11 volatile int y = 0;
13 __attribute__ ((noinline))
14 int main1 ()
16 struct {
17 char *p;
18 char *q;
19 } s;
20 int i;
21 for (i = 0; i < N; i++)
23 cb[i] = i*3;
24 if (y)
25 abort ();
28 /* Check that datarefs analysis can determine that the access via pointer
29 s.p is based off array x, which enables us to antialias this access from
30 the access to array cb. */
31 s.p = x;
32 for (i = 0; i < N; i++)
34 s.p[i] = cb[i];
37 /* check results: */
38 for (i = 0; i < N; i++)
40 if (s.p[i] != cb[i])
41 abort ();
44 /* Check that datarefs analysis can determine that the access via pointer
45 s.p is based off array x, and that the access via pointer s.q is based off
46 array cb, which enables us to antialias these two accesses. */
47 s.q = cb;
48 for (i = 0; i < N; i++)
50 s.p[i] = s.q[i];
53 /* check results: */
54 for (i = 0; i < N; i++)
56 if (s.p[i] != s.q[i])
57 abort ();
60 return 0;
63 int main (void)
65 check_vect ();
67 return main1 ();
71 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
72 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */