aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/reference-reductions.f90
blob: a684d07977cde8614941cf6c2553a74b567f22dc (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
32
33
34
35
36
37
38
! Test reductions on dummy arguments inside modules.

! { dg-do run }

module prm
  implicit none

contains

subroutine param_reduction(var)
  implicit none
  integer(kind=8) :: var
  integer      :: j,k

!$acc parallel copy(var)
!$acc loop reduction(+ : var) gang
 do k=1,10
!$acc loop vector reduction(+ : var)
    do j=1,100
     var = var + 1.0
    enddo
 enddo
!$acc end parallel
end subroutine param_reduction

end module prm

program test
  use prm
  implicit none

  integer(8) :: r

  r=10.0
  call param_reduction (r)

  if (r .ne. 1010) call abort ()
end program test