Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-66.c
blobe0b23cd65509b580325f79dd3391421a14fba874
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 __attribute__ ((noinline))
9 void main1 ()
11 int i, j;
12 int ia[8][5][N+2];
14 /* Multidimensional array. Aligned. */
15 for (i = 0; i < 16; i++)
17 for (j = 0; j < N; j++)
19 ia[2][6][j] = 5;
23 /* check results: */
24 for (i = 0; i < 16; i++)
26 for (j = 0; j < N; j++)
28 if (ia[2][6][j] != 5)
29 abort();
34 __attribute__ ((noinline))
35 void main2 ()
37 int i, j;
38 int ia[8][5][N+2];
40 /* Multidimensional array. Aligned. */
41 for (i = 0; i < 16; i++)
43 for (j = 0; j < N; j++)
44 ia[3][6][j+2] = 5;
47 /* check results: */
48 for (i = 0; i < 16; i++)
50 for (j = 2; j < N+2; j++)
52 if (ia[3][6][j] != 5)
53 abort();
58 __attribute__ ((noinline))
59 void main3 ()
61 int i, j;
62 int ic[16][16][5][N+2];
64 /* Multidimensional array. Not aligned. */
65 for (i = 0; i < 16; i++)
67 for (j = 0; j < N; j++)
69 ic[2][1][6][j+1] = 5;
73 /* check results: */
74 for (i = 0; i < 16; i++)
76 for (j = 0; j < N; j++)
78 if (ic[2][1][6][j+1] != 5)
79 abort();
84 int main (void)
86 check_vect ();
88 main1 ();
89 main2 ();
90 main3 ();
92 return 0;
95 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
96 /* { dg-final { cleanup-tree-dump "vect" } } */