2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / interchange-11.c
blob61028225fc416fe19c35b49d914afe3ac0d7f994
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 double u[1782225];
10 static void __attribute__((noinline))
11 foo (int N, int *res)
13 int i, j;
14 double sum = 0.0;
16 /* These two loops should be interchanged. */
17 for (i = 0; i < 1335; i++)
19 for (j = 0; j < 1335; j++)
20 sum = sum + u[i + 1335 * j];
22 u[1336 * i] *= 2;
24 *res = sum;
27 extern void abort ();
29 int
30 main (void)
32 int i, res;
34 for (i = 0; i < 1782225; i++)
35 u[i] = 2;
37 foo (1335, &res);
39 #if DEBUG
40 fprintf (stderr, "res = %d \n", res);
41 #endif
43 if (res != 3564450)
44 abort ();
46 return 0;
49 /* { dg-final { scan-tree-dump "tiled" "graphite" } } */