00001 #include <omp.h> 00002 00003 extern void abort (void); 00004 00005 int 00006 foo (void) 00007 { 00008 return 10; 00009 } 00010 00011 main () 00012 { 00013 int A = 0; 00014 00015 #pragma omp parallel if (foo () > 10) shared (A) 00016 { 00017 A = omp_get_num_threads (); 00018 } 00019 00020 if (A != 1) 00021 abort (); 00022 00023 #pragma omp parallel if (foo () == 10) num_threads (3) shared (A) 00024 { 00025 A = omp_get_num_threads (); 00026 } 00027 00028 if (A != 3) 00029 abort (); 00030 00031 #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A) 00032 { 00033 A = omp_get_num_threads (); 00034 } 00035 00036 if (A != 10) 00037 abort (); 00038 00039 return 0; 00040 }