aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/task-detach-12.f90
blob: 88546fe473b2598e90e19a885842c28bedcfdcb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program test
    use omp_lib
    implicit none
    integer(omp_event_handle_kind) :: oevent, ievent
    integer :: i
    integer, allocatable :: temp(:)
    ALLOCATE(temp(5))

    !$omp parallel num_threads(3)
    !$omp single
    DO i=1,5
    !$omp task firstprivate(i) firstprivate(temp)  detach(oevent)
          temp(:) = 0;
          temp(1) = -1;
          !print *,temp
          call omp_fulfill_event(oevent)
    !$omp end task
    ENDDO
    !$omp taskwait
    !$omp end single
    !$omp end parallel
end program