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