Dead
[official-gcc.git] / gomp-20050608-branch / gcc / testsuite / gcc.dg / vect / vect-97.c
blobbf92dac7a1a946879792df3e04015b79f2a199a4
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 int main1 ()
9 {
10 struct {
11 char *p;
12 char *q;
13 } s;
14 int i;
15 char x[N] __attribute__ ((__aligned__(16)));
16 char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
18 /* Check that datarefs analysis can determine that the access via pointer
19 s.p is based off array x, which enables us to antialias this access from
20 the access to array cb. */
21 s.p = x;
22 for (i = 0; i < N; i++)
24 s.p[i] = cb[i];
27 /* check results: */
28 for (i = 0; i < N; i++)
30 if (s.p[i] != cb[i])
31 abort ();
34 /* Check that datarefs analysis can determine that the access via pointer
35 s.p is based off array x, and that the access via pointer s.q is based off
36 array cb, which enables us to antialias these two accesses. */
37 s.q = cb;
38 for (i = 0; i < N; i++)
40 s.p[i] = s.q[i];
43 /* check results: */
44 for (i = 0; i < N; i++)
46 if (s.p[i] != s.q[i])
47 abort ();
50 return 0;
53 int main (void)
55 check_vect ();
57 return main1 ();
61 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
62 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
63 /* { dg-final { cleanup-tree-dump "vect" } } */