testsuite/libgomp.c/pr49897-1.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 reduction(+:sum)
00011   {
00012   #pragma omp for firstprivate(x) lastprivate(x, y)
00013     for (i = 0; i < 10; i++)
00014       {
00015     x = i;
00016     y = 0;
00017       #pragma omp parallel reduction(+:sum)
00018     {
00019     #pragma omp for firstprivate(y) lastprivate(y)
00020       for (j = 0; j < 10; j++)
00021         {
00022           y = j;
00023           sum += y;
00024         }
00025     }
00026       }
00027   }
00028   if (x != 9 || y != 9 || sum != 450)
00029     abort ();
00030   return 0;
00031 }

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