Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-76.c
blob999fcb60312d7da7063339077e12a69ec008dff1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 8
7 #define OFF 4
9 typedef int aint __attribute__ ((__aligned__(16)));
11 aint ib[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
13 int main1 (aint *pib)
15 int i;
16 int ia[N+OFF];
17 int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10};
19 for (i = OFF; i < N; i++)
21 ia[i] = pib[i - OFF];
25 /* check results: */
26 for (i = OFF; i < N; i++)
28 if (ia[i] != pib[i - OFF])
29 abort ();
32 for (i = 0; i < N; i++)
34 ia[i] = pib[i - OFF];
38 /* check results: */
39 for (i = 0; i < N; i++)
41 if (ia[i] != pib[i - OFF])
42 abort ();
45 for (i = OFF; i < N; i++)
47 ia[i] = ic[i - OFF];
51 /* check results: */
52 for (i = OFF; i < N; i++)
54 if (ia[i] != ic[i - OFF])
55 abort ();
58 return 0;
61 int main (void)
63 check_vect ();
65 main1 (&ib[OFF]);
66 return 0;
70 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
71 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */