Add runtime tests for interchange and blocking.
[official-gcc/constexpr.git] / gcc / testsuite / gcc.dg / graphite / interchange-9.c
blobd4e05c369af00c61b7830267e4f1d03b0ee7608e
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define N 1111
9 #define M 1111
11 static int __attribute__((noinline))
12 foo (int *x)
14 int i, j;
15 int sum = 0;
17 for (j = 0; j < M; ++j)
18 for (i = 0; i < N; ++i)
19 sum += x[M * i + j];
21 return sum;
24 int
25 main (void)
27 int A[N*M];
28 int i, res;
30 for (i = 0; i < N*M; i++)
31 A[i] = 2;
33 res = foo (A);
35 #if DEBUG
36 fprintf (stderr, "res = %d \n", res);
37 #endif
39 return res != 2468642;
42 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
43 /* { dg-final { cleanup-tree-dump "graphite" } } */