Debian Codegraph @

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

raw
1 /* { dg-require-effective-target size32plus } */
2
3 #define DEBUG 0
4 #if DEBUG
5 #include <stdio.h>
6 #endif
7
8 #define N 200
9 int a[N][N];
10
11 static int __attribute__((noinline))
12 foo (void)
13 {
14 int i, j;
15 int res = 0;
16
17 /* Interchange is not legal for loops 0 and 1. */
18 for (i = 1; i < N; i++)
19 for (j = 1; j < N - 1; j++)
20 a[i][j] = a[i-1][j+1] * a[i-1][j+1] / 2;
21
22 for (i = 0; i < N; i++)
23 res += a[i][i];
24
25 return res;
26 }
27
28 extern void abort ();
29
30 int
31 main (void)
32 {
33 int i, j, res;
34
35 for (i = 0; i < N; i++)
36 for (j = 0; j < N; j++)
37 a[i][j] = i + j;
38
39 res = foo ();
40
41 #if DEBUG
42 fprintf (stderr, "res = %d \n", res);
43 #endif
44
45 if (res != 204007516)
46 abort ();
47
48 return 0;
49 }
50
51 /* { dg-final { scan-tree-dump "tiled by" "graphite" } } */