comparison libgomp/testsuite/libgomp.fortran/task1.f90 @ 0:a06113de4d67

first commit
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 17 Jul 2009 14:47:48 +0900
parents
children 84e7813d76e9
comparison
equal deleted inserted replaced
-1:000000000000 0:a06113de4d67
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