1 #define N 1500
2 
3 int x[N][N], y[N];
4 
5 void abort (void);
6 
foo(void)7 int foo(void)
8 {
9   int i, j;
10 
11   for (i = 0; i < N; i++)
12     y[i] = i;
13 
14   for (i = 0; i < N; i++)
15     for (j = 0; j < N; j++)
16       x[i][j] = i + j;
17 
18   for (i = 0; i < N; i++)
19     {
20       y[i] = i;
21 
22       for (j = 0; j < N; j++)
23 	{
24 	  if (j > 500)
25 	    {
26 	      x[i][j] = i + j + 3;
27 	      y[j] = i*j + 10;
28 	    }
29 	  else
30 	    x[i][j] = x[i][j]*3;
31 	}
32     }
33 
34   return x[2][5]*y[8];
35 }
36 
main(void)37 int main(void)
38 {
39   if (168 != foo())
40     abort ();
41 
42   return 0;
43 }
44 
45 /* Check that parallel code generation part make the right answer.  */
46 /* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
47 /* { dg-final { scan-tree-dump-times "3 loops carried no dependency" 1 "graphite" } } */
48 /* { dg-final { scan-tree-dump-times "5 loops carried no dependency" 1 "graphite" } } */
49 /* { dg-final { cleanup-tree-dump "graphite" } } */
50 /* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
51 /* { dg-final { scan-tree-dump-times "loopfn.1" 5 "optimized" } } */
52 /* { dg-final { cleanup-tree-dump "parloops" } } */
53 /* { dg-final { cleanup-tree-dump "optimized" } } */
54