PR libfortran/64770 Segfault when trying to open existing file with status="new".
[official-gcc.git] / gcc / testsuite / gcc.dg / graphite / block-8.c
blob4e2f358fca7ef8bc48be7533af942b3382cc9b59
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 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
20 A[i][j] = 0;
22 /* This should be blocked. */
23 for (i = 0; i < N; i++)
24 for (j = 0; j < N; j++)
25 for (k = 0; k < N; k++)
26 A[i][j] += B[i][k] * C[k][j];
29 extern void abort ();
31 int
32 main (void)
34 int i, j, res = 0;
36 for (i = 0; i < N; i++)
37 for (j = 0; j < N; j++)
39 B[i][j] = j;
40 C[i][j] = i;
43 matmult ();
45 for (i = 0; i < N; i++)
46 res += A[i][i];
48 #if DEBUG
49 fprintf (stderr, "res = %d \n", res);
50 #endif
52 if (res != 529340000)
53 abort ();
55 return 0;
58 /* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
59 /* { dg-final { cleanup-tree-dump "graphite" } } */