Rebase.
[official-gcc.git] / libgomp / testsuite / libgomp.c / pr49897-1.c
blobd21a26252b9877e35b18e56649705450fd035fe6
1 /* PR middle-end/49897 */
2 /* { dg-do run } */
4 extern void abort (void);
6 int
7 main ()
9 int i, j, x = 0, y, sum = 0;
10 #pragma omp parallel reduction(+:sum)
12 #pragma omp for firstprivate(x) lastprivate(x, y)
13 for (i = 0; i < 10; i++)
15 x = i;
16 y = 0;
17 #pragma omp parallel reduction(+:sum)
19 #pragma omp for firstprivate(y) lastprivate(y)
20 for (j = 0; j < 10; j++)
22 y = j;
23 sum += y;
28 if (x != 9 || y != 9 || sum != 450)
29 abort ();
30 return 0;