testsuite/libgomp.c++/pr38650.C

Go to the documentation of this file.
00001 // PR c++/38650
00002 // { dg-do run }
00003 
00004 #include <cstdlib>
00005 
00006 int e;
00007 
00008 int
00009 main ()
00010 {
00011   volatile int i, j = 10;
00012   e = 0;
00013 #pragma omp parallel for reduction(+:e)
00014   for (i = 0; i < j; i += 1)
00015     e++;
00016   if (e != 10)
00017     std::abort ();
00018   e = 0;
00019 #pragma omp parallel for reduction(+:e)
00020   for (i = 0; i < j; ++i)
00021     e++;
00022   if (e != 10)
00023     std::abort ();
00024   e = 0;
00025 #pragma omp parallel for reduction(+:e)
00026   for (i = 0; i < j; i++)
00027     e++;
00028   if (e != 10)
00029     std::abort ();
00030   e = 0;
00031 #pragma omp parallel for reduction(+:e)
00032   for (i = 0; i < 10; i += 1)
00033     e++;
00034   if (e != 10)
00035     std::abort ();
00036   e = 0;
00037 #pragma omp parallel for reduction(+:e)
00038   for (i = 0; i < 10; ++i)
00039     e++;
00040   if (e != 10)
00041     std::abort ();
00042   e = 0;
00043 #pragma omp parallel for reduction(+:e)
00044   for (i = 0; i < 10; i++)
00045     e++;
00046   if (e != 10)
00047     std::abort ();
00048   return 0;
00049 }

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