PR c++/86342 - -Wdeprecated-copy and system headers.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / task3.f90
blobfcff52ad0165b0fa7ee00a4d69f016c17eba2559
1 ! { dg-do run }
3 ! PR fortran/47886
5 ! Test case contributed by Bill Long
7 ! derived from OpenMP test OMP3f/F03_2_7_1d.F90
8 program F03_2_7_1d
9 use omp_lib
10 implicit none
11 integer, parameter :: NT = 4
12 integer :: sum = 0
14 call omp_set_num_threads(NT);
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
26 end program F03_2_7_1d