2012-03-27 23:13:14 +00:00
|
|
|
#define N 500
|
|
|
|
|
|
|
|
int A[N+5][N+5][N+5];
|
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
void abort (void);
|
|
|
|
|
|
|
|
int foo (void)
|
2012-03-27 23:13:14 +00:00
|
|
|
{
|
|
|
|
int i, j, k;
|
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
for (i = 0; i < N + 5; i++)
|
|
|
|
for (j = 0; j < N + 5; j++)
|
|
|
|
for (k = 0; k < N + 5; k++)
|
|
|
|
A[i][j][k] = i + j + k;
|
|
|
|
|
2012-03-27 23:13:14 +00:00
|
|
|
/* Loop i: carried no dependency. */
|
|
|
|
for (i = 0; i < N; i++)
|
|
|
|
for (j = 0; j < N; j++)
|
|
|
|
for (k = 0; k < N; k++)
|
|
|
|
A[k+1][j+2][i+1] = A[k][j][i+1];
|
|
|
|
|
|
|
|
return A[1][5][2];
|
|
|
|
}
|
|
|
|
|
2014-09-21 17:33:12 +00:00
|
|
|
int main (void)
|
2012-03-27 23:13:14 +00:00
|
|
|
{
|
2014-09-21 17:33:12 +00:00
|
|
|
if (5 != foo ())
|
|
|
|
abort ();
|
2012-03-27 23:13:14 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that parallel code generation part make the right answer. */
|
|
|
|
/* { dg-final { scan-tree-dump-times "3 loops carried no dependency" 1 "graphite" } } */
|
|
|
|
/* { dg-final { cleanup-tree-dump "graphite" } } */
|
2014-09-21 17:33:12 +00:00
|
|
|
/* { dg-final { scan-tree-dump-times "loopfn.0" 4 "optimized" } } */
|
2012-03-27 23:13:14 +00:00
|
|
|
/* { dg-final { cleanup-tree-dump "parloops" } } */
|
|
|
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|