libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-64.c
blob2513ba31d1d485c710be53f8072674e42dab5291
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-additional-options "-fdump-tree-optimized-details-blocks" } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 16
9 int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 __attribute__ ((noinline))
12 int main1 ()
14 int i, j;
15 int ia[N][4][N+1];
16 int ic[N][N][3][N+1];
17 int id[N][N][N+1];
19 /* Multidimensional array. Not aligned: vectorizable. */
20 for (i = 0; i < N; i++)
22 for (j = 0; j < N; j++)
24 ia[i][1][j] = ib[i];
28 /* Multidimensional array. Aligned: vectorizable. */
29 for (i = 0; i < N; i++)
31 for (j = 0; j < N; j++)
33 ic[i][1][1][j] = ib[i];
37 /* Multidimensional array. Not aligned: vectorizable. */
38 for (i = 0; i < N; i++)
40 for (j = 0; j < N; j++)
42 id[i][1][j+1] = ib[i];
46 /* check results: */
47 for (i = 0; i < N; i++)
49 #pragma GCC novector
50 for (j = 0; j < N; j++)
52 if (ia[i][1][j] != ib[i])
53 abort();
57 /* check results: */
58 for (i = 0; i < N; i++)
60 #pragma GCC novector
61 for (j = 0; j < N; j++)
63 if (ic[i][1][1][j] != ib[i])
64 abort();
68 /* check results: */
69 for (i = 0; i < N; i++)
71 #pragma GCC novector
72 for (j = 0; j < N; j++)
74 if (id[i][1][j+1] != ib[i])
75 abort();
79 return 0;
82 int main (void)
84 check_vect ();
86 return main1 ();
89 /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
90 /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */