aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/task-in-explicit-3.f90
blob: 629c5676c0577095589eee36e1fb103cadb56e31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
! { dg-do run }

module m
  integer :: a
end module m

program main
  use omp_lib
  use m
  implicit none
  !$omp task
    if (.not. omp_in_explicit_task ()) &
      error stop
    !$omp task
      if (.not. omp_in_explicit_task ()) &
        error stop
      !$omp taskgroup task_reduction (+: a)
        if (.not. omp_in_explicit_task ()) &
          error stop
	!$omp task in_reduction (+: a)
          a = a + 1
          if (.not. omp_in_explicit_task ()) &
            error stop
	!$omp end task
      !$omp end taskgroup
      if (.not. omp_in_explicit_task ()) &
        error stop
      !$omp taskwait
    !$omp end task
  !$omp end task
end