testsuite/libgomp.c/pr35549.c

Go to the documentation of this file.
00001 /* PR middle-end/35549 */
00002 /* { dg-do run } */
00003 
00004 #include <omp.h>
00005 #include <stdlib.h>
00006 
00007 int
00008 main (void)
00009 {
00010   int i = 6, n = 0;
00011   omp_set_dynamic (0);
00012   omp_set_nested (1);
00013   #pragma omp parallel shared (i) num_threads (3)
00014   {
00015     if (omp_get_num_threads () != 3)
00016       #pragma omp atomic
00017     n += 1;
00018     #pragma omp parallel shared (i) num_threads (4)
00019     {
00020       if (omp_get_num_threads () != 4)
00021     #pragma omp atomic
00022       n += 1;
00023       #pragma omp critical
00024     i += 1;
00025     }
00026   }
00027   if (n == 0 && i != 6 + 3 * 4)
00028     abort ();
00029   return 0;
00030 }

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