2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / block-4.c
blob0deaec14e7a6c746792a2088d4632d916b029966
1 /* { dg-require-effective-target size32plus } */
2 /* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
4 #define DEBUG 0
5 #if DEBUG
6 #include <stdio.h>
7 #endif
9 #define N 24
10 #define M 1000
12 int A[M][M], B[M][M], C[M][M];
14 static int __attribute__((noinline))
15 foo (void)
17 int i, j, k;
19 /* This should NOT be blocked. */
20 for (i = 0; i < 24; i++)
21 for (j = 0; j < 24; j++)
22 for (k = 0; k < 24; k++)
23 A[i][j] = B[i][k] * C[k][j];
25 /* This should be blocked. */
26 for (i = 0; i < M; i++)
27 for (j = 0; j < M; j++)
28 for (k = 0; k < M; k++)
29 A[i][j] = B[i][k] * C[k][j];
31 return A[0][0] + A[M-1][M-1];
34 extern void abort ();
36 int
37 main (void)
39 int i, j, res;
41 for (i = 0; i < M; i++)
42 for (j = 0; j < M; j++)
44 B[i][j] = i;
45 C[i][j] = j;
48 res = foo ();
50 #if DEBUG
51 fprintf (stderr, "res = %d \n", res);
52 #endif
54 if (res != 998001)
55 abort ();
57 return 0;
60 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */