1! { dg-do run }
2
3! Test the task detach clause used together with dependencies.
4
5program task_detach_3
6
7  use omp_lib
8
9  integer (kind=omp_event_handle_kind) :: detach_event
10  integer :: x = 0, y = 0, z = 0
11  integer :: dep
12
13  !$omp parallel
14    !$omp single
15      !$omp task depend (out:dep) detach (detach_event)
16        x = x + 1
17      !$omp end task
18
19      !$omp task
20        y = y + 1
21	call omp_fulfill_event (detach_event)
22      !$omp end task
23
24      !$omp task depend (in:dep)
25        z = z + 1
26      !$omp end task
27    !$omp end single
28  !$omp end parallel
29
30  if (x /= 1) stop 1
31  if (y /= 1) stop 2
32  if (z /= 1) stop 3
33end program
34