testsuite/libgomp.c/pr34513.c

Go to the documentation of this file.
00001 /* PR c++/34513 */
00002 /* { dg-do run } */
00003 
00004 #include <omp.h>
00005 
00006 extern void abort ();
00007 
00008 static int errors = 0;
00009 static int thrs = 4;
00010 
00011 int
00012 main ()
00013 {
00014   omp_set_dynamic (0);
00015 
00016   #pragma omp parallel num_threads (thrs)
00017   {
00018     static int shrd = 0;
00019 
00020     #pragma omp atomic
00021       shrd += 1;
00022 
00023     #pragma omp barrier
00024 
00025     if (shrd != thrs)
00026       #pragma omp atomic
00027     errors += 1;
00028   }
00029 
00030   if (errors)
00031     abort ();
00032   return 0;
00033 }

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