PR target/55146
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-65.c
blobba3ab3a9b15750ec53129e130fe3eb0872286ce1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
7 #define M 4
9 __attribute__ ((noinline))
10 int main1 ()
12 int i, j;
13 int ib[M][M][N] = {{{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
14 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
15 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
16 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
17 {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
18 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
19 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
20 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
21 {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
22 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
23 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
24 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}},
25 {{0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
26 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
27 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45},
28 {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}}};
29 int ia[M][M][N];
30 int ic[N];
32 /* Multidimensional array. Aligned. The "inner" dimensions
33 are invariant in the inner loop. Load and store. */
34 for (i = 0; i < M; i++)
36 for (j = 0; j < N; j++)
38 ia[i][1][j] = ib[2][i][j];
42 /* check results: */
43 for (i = 0; i < M; i++)
45 for (j = 0; j < N; j++)
47 if (ia[i][1][j] != ib[2][i][j])
48 abort();
52 /* Multidimensional array. Aligned. The "inner" dimensions
53 are invariant in the inner loop. Load. */
54 for (i = 0; i < M; i++)
56 for (j = 0; j < N; j++)
58 ic[j] = ib[2][i][j];
62 /* check results: */
63 for (i = 0; i < M; i++)
65 for (j = 0; j < N; j++)
67 if (ic[j] != ib[2][i][j])
68 abort();
72 return 0;
75 int main (void)
77 check_vect ();
79 return main1 ();
82 /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
83 /* { dg-final { cleanup-tree-dump "vect" } } */