aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/routine-4.f90
blob: 3e5fb09c45cb868e55ddea5af4bac4955f076688 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do run }
! { dg-options "-fno-inline" }

  integer, parameter :: n = 10
  integer :: a(n), i
  do i = 1, n
     a(i) = i
  end do
  !$acc parallel
  !$acc loop
  do i = 1, n
     call incr(a(i))
  end do
  !$acc end parallel
  do i = 1, n
     if (a(i) .ne. (i + 1)) call abort
  end do
end
subroutine incr (x)
  !$acc routine
  integer, intent(inout) :: x
  x = x + 1
end subroutine incr