testsuite/libgomp.c/pr49897-2.c

Go to the documentation of this file.
00001 /* PR middle-end/49897 */
00002 /* { dg-do run } */
00003 
00004 extern void abort (void);
00005 
00006 int
00007 main ()
00008 {
00009   int i, j, x = 0, y, sum = 0;
00010 #pragma omp parallel for reduction(+:sum) firstprivate(x) lastprivate(x, y)
00011   for (i = 0; i < 10; i++)
00012     {
00013       x = i;
00014       y = 0;
00015     #pragma omp parallel for reduction(+:sum) firstprivate(y) lastprivate(y)
00016       for (j = 0; j < 10; j++)
00017     {
00018       y = j;
00019       sum += y;
00020     }
00021     }
00022   if (x != 9 || y != 9 || sum != 450)
00023     abort ();
00024   return 0;
00025 }

Generated on Fri Apr 5 05:38:10 2013 for Libgomp by  doxygen 1.4.7