1! { dg-do run } 2! 3! PR fortran/47886 4! 5! Test case contributed by Bill Long 6 7! derived from OpenMP test OMP3f/F03_2_7_1d.F90 8program F03_2_7_1d 9 use omp_lib 10 implicit none 11 integer, parameter :: NT = 4 12 integer :: sum = 0 13 14 call omp_set_num_threads(NT); 15 16 !$omp parallel 17 !$omp task if(omp_get_num_threads() > 0) 18 !$omp atomic 19 sum = sum + 1 20 !$omp end task 21 !$omp end parallel 22 if (sum /= NT) then 23 print *, "FAIL - sum == ", sum, " (expected ", NT, ")" 24 STOP 1 25 end if 26end program F03_2_7_1d 27