0
|
1 ! { dg-do run }
|
|
2
|
|
3 program tasktest
|
|
4 use omp_lib
|
|
5 integer :: i, j
|
|
6 common /tasktest_j/ j
|
|
7 j = 0
|
|
8 !$omp parallel private (i)
|
|
9 i = omp_get_thread_num ()
|
|
10 if (i.lt.2) then
|
|
11 !$omp task if (.false.) default(firstprivate)
|
|
12 call subr (i + 1)
|
|
13 !$omp end task
|
|
14 end if
|
|
15 !$omp end parallel
|
|
16 if (j.gt.0) call abort
|
|
17 contains
|
|
18 subroutine subr (i)
|
|
19 use omp_lib
|
|
20 integer :: i, j
|
|
21 common /tasktest_j/ j
|
|
22 if (omp_get_thread_num ().ne.(i - 1)) then
|
|
23 !$omp atomic
|
|
24 j = j + 1
|
|
25 end if
|
|
26 end subroutine subr
|
|
27 end program tasktest
|