d: Add language reference section to documentation files.
[official-gcc.git] / libgomp / testsuite / libgomp.fortran / task-detach-3.f90
blob5ac68d55802c2c04a871141b3473acdbb649bc74
1 ! { dg-do run }
3 ! Test the task detach clause used together with dependencies.
5 program task_detach_3
7 use omp_lib
9 integer (kind=omp_event_handle_kind) :: detach_event
10 integer :: x = 0, y = 0, z = 0
11 integer :: dep
13 !$omp parallel
14 !$omp single
15 !$omp task depend (out:dep) detach (detach_event)
16 x = x + 1
17 !$omp end task
19 !$omp task
20 y = y + 1
21 call omp_fulfill_event (detach_event)
22 !$omp end task
24 !$omp task depend (in:dep)
25 z = z + 1
26 !$omp end task
27 !$omp end single
28 !$omp end parallel
30 if (x /= 1) stop 1
31 if (y /= 1) stop 2
32 if (z /= 1) stop 3
33 end program