1 /* PR tree-optimization/46194 */
2 /* { dg-do compile } */
3 /* { dg-options "-O -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
4 
5 #define N 1000
6 int a[N];
7 
foo(void)8 int foo (void)
9 {
10   int j;
11   int i;
12 
13   /* This is not blocked as it is not profitable.  */
14   for (i = 0; i < N; i++)
15     for (j = 0; j < N; j++)
16       a[j] = a[i] + 1;
17 
18   return a[0];
19 }
20 
21 /* This loop cannot be parallelized due to a dependence.  */
22 
23 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
24 /* { dg-final { cleanup-tree-dump "parloops" } } */
25