2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / block-7.c
blob4e5c5760fadd54bcf049d4edd5033509e951fa24
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 200
11 int A[N][N], B[N][N], C[N][N];
13 static void __attribute__((noinline))
14 matmult (void)
16 int i, j, k;
18 /* This should be blocked. */
19 for (i = 0; i < N; i++)
20 for (j = 0; j < N; j++)
22 A[i][j] = 0;
23 for (k = 0; k < N; k++)
24 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 "tiled by" "graphite" } } */