OSDN Git Service

2009-01-10 Sebastian Pop <sebastian.pop@amd.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / graphite / block-1.c
1 /* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
2
3 #define MAX 8192
4
5 void bar (void);
6
7 int main()
8 {
9   int i, j;
10   int sum = 0;
11   int A[MAX * MAX];
12   int B[MAX * MAX];
13
14   bar ();
15
16   for (i = 0; i < MAX; i++)
17     for (j = 0; j < MAX; j++)
18       {
19         A[i*MAX + j] = j;
20         B[i*MAX + j] = j;
21       }
22
23   for (i = 0; i < MAX; i++)
24     for (j = 0; j < MAX; j++)
25       A[i*MAX + j] += B[j*MAX + i];
26
27   bar ();
28
29   /* FIXME: For now, reductions are not handled by the code generation
30      of graphite.  We have to bound the scop to the above loops.  */
31
32   for(i = 0; i < MAX; i++)
33     for(j = 0; j < MAX; j++)
34       sum += A[i*MAX + j];
35
36   return sum;
37 }
38
39 /* { dg-final { scan-tree-dump-times "will be loop blocked" 2 "graphite"} } */ 
40 /* { dg-final { cleanup-tree-dump "graphite" } } */