Add runtime tests for interchange and blocking.
[official-gcc/constexpr.git] / gcc / testsuite / gcc.dg / graphite / interchange-6.c
blob2ff886cf7ee470d23d9843126fe3c92f720b13df
1 /* { dg-require-effective-target size32plus } */
3 /* Formerly known as ltrans-6.c */
5 #define DEBUG 0
6 #if DEBUG
7 #include <stdio.h>
8 #endif
10 #define N 100
11 #define M 200
13 static int __attribute__((noinline))
14 foo (int A[N][M])
16 int i, j;
18 /* This loop should be interchanged. */
19 for(j = 0; j < M; j++)
20 for(i = 0; i < N; i++)
21 A[i][j] = A[i][j] + A[i][j];
23 return A[0][0] + A[N-1][M-1];
26 int
27 main (void)
29 int A[N][M];
30 int i, j, res;
32 for (i = 0; i < N; i++)
33 for (j = 0; j < M; j++)
34 A[i][j] = 2;
36 res = foo (A);
38 #if DEBUG
39 fprintf (stderr, "res = %d \n", res);
40 #endif
42 return res != 8;
45 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
46 /* { dg-final { cleanup-tree-dump "graphite" } } */