testsuite/libgomp.c/icv-1.c

Go to the documentation of this file.
00001 #include <omp.h>
00002 #include <stdlib.h>
00003 
00004 int
00005 main (void)
00006 {
00007   int err = 0;
00008 
00009   omp_set_num_threads (4);
00010   if (omp_get_max_threads () != 4)
00011     abort ();
00012   #pragma omp parallel reduction(|: err) num_threads(1)
00013   {
00014     if (omp_get_max_threads () != 4)
00015       err |= 1;
00016     omp_set_num_threads (6);
00017     #pragma omp task if(0) shared(err)
00018     {
00019       if (omp_get_max_threads () != 6)
00020     err |= 2;
00021       omp_set_num_threads (5);
00022       if (omp_get_max_threads () != 5)
00023     err |= 4;
00024     }
00025     if (omp_get_max_threads () != 6)
00026       err |= 8;
00027   }
00028   if (err)
00029     abort ();
00030   if (omp_get_max_threads () != 4)
00031     abort ();
00032   return 0;
00033 }

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