Debian Codegraph @

gcc/testsuite/gcc.dg/graphite/block-7.c

raw
1 /* { dg-require-effective-target size32plus } */
2 /* { dg-require-effective-target run_expensive_tests } PR testsuite/48283 */
3
4 #define DEBUG 0
5 #if DEBUG
6 #include <stdio.h>
7 #endif
8
9 #define N 200
10
11 int A[N][N], B[N][N], C[N][N];
12
13 static void __attribute__((noinline))
14 matmult (void)
15 {
16 int i, j, k;
17
18 /* This should be blocked. */
19 for (i = 0; i < N; i++)
20 for (j = 0; j < N; j++)
21 {
22 A[i][j] = 0;
23 for (k = 0; k < N; k++)
24 A[i][j] += B[i][k] * C[k][j];
25 }
26 }
27
28 extern void abort ();
29
30 int
31 main (void)
32 {
33 int i, j, res = 0;
34
35 for (i = 0; i < N; i++)
36 for (j = 0; j < N; j++)
37 {
38 B[i][j] = j;
39 C[i][j] = i;
40 }
41
42 matmult ();
43
44 for (i = 0; i < N; i++)
45 res += A[i][i];
46
47 #if DEBUG
48 fprintf (stderr, "res = %d \n", res);
49 #endif
50
51 if (res != 529340000)
52 abort ();
53
54 return 0;
55 }
56
57 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */