1 /* { dg-require-effective-target vect_int } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
9
10 __attribute__ ((noinline))
main1()11 int main1 ()
12 {
13 int i, j;
14 int ia[N][4][N+1];
15 int ic[N][N][3][N+1];
16 int id[N][N][N+1];
17
18 /* Multidimensional array. Not aligned: vectorizable. */
19 for (i = 0; i < N; i++)
20 {
21 for (j = 0; j < N; j++)
22 {
23 ia[i][1][j] = ib[i];
24 }
25 }
26
27 /* Multidimensional array. Aligned: vectorizable. */
28 for (i = 0; i < N; i++)
29 {
30 for (j = 0; j < N; j++)
31 {
32 ic[i][1][1][j] = ib[i];
33 }
34 }
35
36 /* Multidimensional array. Not aligned: vectorizable. */
37 for (i = 0; i < N; i++)
38 {
39 for (j = 0; j < N; j++)
40 {
41 id[i][1][j+1] = ib[i];
42 }
43 }
44
45 /* check results: */
46 for (i = 0; i < N; i++)
47 {
48 for (j = 0; j < N; j++)
49 {
50 if (ia[i][1][j] != ib[i])
51 abort();
52 }
53 }
54
55 /* check results: */
56 for (i = 0; i < N; i++)
57 {
58 for (j = 0; j < N; j++)
59 {
60 if (ic[i][1][1][j] != ib[i])
61 abort();
62 }
63 }
64
65 /* check results: */
66 for (i = 0; i < N; i++)
67 {
68 for (j = 0; j < N; j++)
69 {
70 if (id[i][1][j+1] != ib[i])
71 abort();
72 }
73 }
74
75 return 0;
76 }
77
main(void)78 int main (void)
79 {
80 check_vect ();
81
82 return main1 ();
83 }
84
85 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
86