Merge from google/integration.
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / block-8.c
blob9c1c9cebe839bc28bc053a943735eb01be177838
1 /* { dg-require-effective-target size32plus } */
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
8 #define N 200
10 int A[N][N], B[N][N], C[N][N];
12 static void __attribute__((noinline))
13 matmult (void)
15 int i, j, k;
17 for (i = 0; i < N; i++)
18 for (j = 0; j < N; j++)
19 A[i][j] = 0;
21 /* This should be blocked. */
22 for (i = 0; i < N; i++)
23 for (j = 0; j < N; j++)
24 for (k = 0; k < N; k++)
25 A[i][j] += B[i][k] * C[k][j];
28 extern void abort ();
30 int
31 main (void)
33 int i, j, res = 0;
35 for (i = 0; i < N; i++)
36 for (j = 0; j < N; j++)
38 B[i][j] = j;
39 C[i][j] = i;
42 matmult ();
44 for (i = 0; i < N; i++)
45 res += A[i][i];
47 #if DEBUG
48 fprintf (stderr, "res = %d \n", res);
49 #endif
51 if (res != 529340000)
52 abort ();
54 return 0;
57 /* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
58 /* { dg-final { cleanup-tree-dump "graphite" } } */