1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-parallelize-loops=4 -fdump-tree-parloops-details -fdump-tree-optimized" } */
3 
4 void abort (void);
5 
parloop(int N)6 void parloop (int N)
7 {
8   int i;
9   int x[10000990];
10 
11   for (i = 0; i < N; i++)
12     x[i] = i + 3;
13 
14   for (i = 0; i < N; i++)
15     {
16       if (x[i] != i + 3)
17 	abort ();
18     }
19 }
20 
main(void)21 int main(void)
22 {
23   parloop(10000);
24 
25   return 0;
26 }
27 
28 /* Check that the first loop in parloop got parallelized.  */
29 
30 /* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
31 /* { dg-final { scan-tree-dump-times "loopfn" 4 "optimized" } } */
32 /* { dg-final { cleanup-tree-dump "parloops" } } */
33 /* { dg-final { cleanup-tree-dump "optimized" } } */
34