aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.fortran/target-in-reduction-2.f90
blob: 7f2e16b534b0cd7a3064e73bb8d1ad51343667a6 (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
! { dg-do run }

program main
  integer :: x

  x = 0
  !$omp taskgroup task_reduction (+: x)
  call foo (x)
  call bar (x)
  !$omp end taskgroup

  if (x .ne. 3) stop 1

contains

  subroutine foo (x)
    integer :: x
    !$omp task in_reduction (+: x)
    x = x + 1
    !$omp end task
  end subroutine foo

  subroutine bar (x)
    integer :: x
    !$omp target in_reduction (+: x)
    x = x + 2
    !$omp end target
  end subroutine bar

end program main