testsuite/libgomp.c/loop-10.c

Go to the documentation of this file.
00001 extern void abort (void);
00002 
00003 int i = 8;
00004 
00005 int main (void)
00006 {
00007   int j = 7, k = 0;
00008   #pragma omp for
00009   for (i = 0; i < 10; i++)
00010     ;
00011   #pragma omp for
00012   for (j = 0; j < 10; j++)
00013     ;
00014   /* OpenMP 3.0 newly guarantees that the original list items can't
00015      be shared with the privatized omp for iterators, even when
00016      the original list items are already private.  */
00017   if (i != 8 || j != 7)
00018     abort ();
00019   #pragma omp parallel private (i) reduction (+:k)
00020   {
00021     i = 6;
00022     #pragma omp for
00023     for (i = 0; i < 10; i++)
00024       ;
00025     k = (i != 6);
00026   }
00027   if (k)
00028     abort ();
00029   return 0;
00030 }

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