Add support for ARMv8-R architecture
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / task3.f90
blob30ff9803ea27ea66bee48dbc66f23506c66f3909
1 ! { dg-do run }
2 ! { dg-options "-fopenmp" }
4 ! PR fortran/47886
6 ! Test case contributed by Bill Long
8 ! derived from OpenMP test OMP3f/F03_2_7_1d.F90
9 program F03_2_7_1d
10 use omp_lib
11 implicit none
12 integer, parameter :: NT = 4
13 integer :: sum = 0
15 call omp_set_num_threads(NT);
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
27 end program F03_2_7_1d