Add runtime tests for interchange and blocking.
[official-gcc/constexpr.git] / gcc / testsuite / gcc.dg / graphite / interchange-3.c
blob95c228d07e866b3a2f0d7b419de67ace684ba684
1 /* { dg-require-effective-target size32plus } */
3 /* Formerly known as ltrans-3.c */
5 #define DEBUG 0
6 #if DEBUG
7 #include <stdio.h>
8 #endif
10 double u[1782225];
12 static void __attribute__((noinline))
13 foo (int N, int *res)
15 unsigned int i, j;
16 double sum = 0;
17 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
21 sum = sum + u[i + 1335 * j];
25 *res = sum + N + u[1336 * 2] + u[1336];
28 int
29 main (void)
31 int i, j, res;
33 for (i = 0; i < 1782225; i++)
34 u[i] = 2;
36 foo (1335, &res);
38 #if DEBUG
39 fprintf (stderr, "res = %d \n", res);
40 #endif
42 return res != 3565789;
45 /* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
46 /* { dg-final { cleanup-tree-dump "graphite" } } */