[multiple changes]
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-37.c
blob8bd125a862a13bc060a6b4390c6af74167bf0520
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 char x[N] __attribute__ ((__aligned__(16)));
9 int main1 (char *y)
11 struct {
12 char *p;
13 char *q;
14 } s;
15 char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
16 int i;
18 /* Not vectorized - can't antialias the pointer s.p from the array cb. */
19 s.p = y;
20 for (i = 0; i < N; i++)
22 s.p[i] = cb[i];
25 /* check results: */
26 for (i = 0; i < N; i++)
28 if (s.p[i] != cb[i])
29 abort ();
32 /* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */
33 s.q = cb;
34 for (i = 0; i < N; i++)
36 s.p[i] = s.q[i];
39 /* check results: */
40 for (i = 0; i < N; i++)
42 if (s.p[i] != s.q[i])
43 abort ();
46 return 0;
49 int main (void)
51 check_vect ();
53 return main1 (x);
56 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
57 /* { dg-final { cleanup-tree-dump "vect" } } */