X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=libgomp%2Ftestsuite%2Flibgomp.c%2Fomp-parallel-if.c;fp=libgomp%2Ftestsuite%2Flibgomp.c%2Fomp-parallel-if.c;h=5e378359aacec79bf6516693d0627e7d602ec9aa;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=0000000000000000000000000000000000000000;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/libgomp/testsuite/libgomp.c/omp-parallel-if.c b/libgomp/testsuite/libgomp.c/omp-parallel-if.c new file mode 100644 index 00000000..5e378359 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/omp-parallel-if.c @@ -0,0 +1,40 @@ +#include + +extern void abort (void); + +int +foo (void) +{ + return 10; +} + +main () +{ + int A = 0; + + #pragma omp parallel if (foo () > 10) shared (A) + { + A = omp_get_num_threads (); + } + + if (A != 1) + abort (); + + #pragma omp parallel if (foo () == 10) num_threads (3) shared (A) + { + A = omp_get_num_threads (); + } + + if (A != 3) + abort (); + + #pragma omp parallel if (foo () == 10) num_threads (foo ()) shared (A) + { + A = omp_get_num_threads (); + } + + if (A != 10) + abort (); + + return 0; +}