Rebase.
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr38650.c
blob7066239b07013e7409c38268f4828f54885d5c8a
1 /* PR c++/38650 */
2 /* { dg-do run } */
4 #include <stdlib.h>
6 int e;
8 int
9 main ()
11 volatile int i, j = 10;
12 e = 0;
13 #pragma omp parallel for reduction(+:e)
14 for (i = 0; i < j; i += 1)
15 e++;
16 if (e != 10)
17 abort ();
18 e = 0;
19 #pragma omp parallel for reduction(+:e)
20 for (i = 0; i < j; ++i)
21 e++;
22 if (e != 10)
23 abort ();
24 e = 0;
25 #pragma omp parallel for reduction(+:e)
26 for (i = 0; i < j; i++)
27 e++;
28 if (e != 10)
29 abort ();
30 e = 0;
31 #pragma omp parallel for reduction(+:e)
32 for (i = 0; i < 10; i += 1)
33 e++;
34 if (e != 10)
35 abort ();
36 e = 0;
37 #pragma omp parallel for reduction(+:e)
38 for (i = 0; i < 10; ++i)
39 e++;
40 if (e != 10)
41 abort ();
42 e = 0;
43 #pragma omp parallel for reduction(+:e)
44 for (i = 0; i < 10; i++)
45 e++;
46 if (e != 10)
47 abort ();
48 return 0;