OSDN Git Service

42f7b6aade3cd6963e81f1fc1263d0e6aee95a0c
[pf3gnuchains/pf3gnuchains3x.git] / gcc / testsuite / gcc.dg / graphite / scop-16.c
1 /* { dg-options "-O2 -floop-block -fdump-tree-graphite-all" } */
2 #define N 10000
3 void foo (int);
4 int test ()
5 {
6   int a[N][N];
7   int b[N][N];
8   unsigned i, j;
9
10   for (i = 0; i < N; i++) 
11     for (j = 0; j < N; j++)
12       a[i][j] = i*j;
13
14   for (j = 1; j < N; j++) 
15     for (i = 0; i < N; i++)
16       a[i][j] = a[i][j-1] + b[i][j];
17
18   for (i = 0; i < N; i++) 
19     for (j = 0; j < N; j++) 
20       foo (a[i][j]); 
21 }
22
23 /* Interchange is legal for loops 0 and 1 of the first two SCoPs */
24 /* { dg-final { scan-tree-dump-times "Interchange valid for loops 0 and 1:" 2 "graphite"} } */
25 /* { dg-final { cleanup-tree-dump "graphite" } } */