Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-62.c
blob79f8876155ed480753b9a91482093e3a57c2bdbe
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 int main1 ()
10 int i, j;
11 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
12 int ia[N][4][N+8];
14 /* Multidimensional array. Aligned. The "inner" dimensions
15 are invariant in the inner loop. Store. */
16 for (i = 0; i < N; i++)
18 for (j = 0; j < N; j++)
20 ia[i][1][j+8] = ib[i];
24 /* check results: */
25 for (i = 0; i < N; i++)
27 for (j = 0; j < N; j++)
29 if (ia[i][1][j+8] != ib[i])
30 abort();
34 /* Multidimensional array. Aligned. The "inner" dimensions
35 are invariant in the inner loop. Vectorizable, but the
36 vectorizer detects that everything is invariant and that
37 the loop is better left untouched. (it should be optimized away). */
38 for (i = 0; i < N; i++)
40 for (j = 0; j < N; j++)
42 ia[i][1][8] = ib[i];
46 /* check results: */
47 for (i = 0; i < N; i++)
49 for (j = 0; j < N; j++)
51 if (ia[i][1][8] != ib[i])
52 abort();
57 return 0;
60 int main (void)
62 check_vect ();
64 return main1 ();
67 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
68 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
69 /* { dg-final { cleanup-tree-dump "vect" } } */