summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-fortran/declare-5.f90
blob: 4f5c8f00120772774a974f789dddaf0bd8df4812 (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
! { dg-do run }

module vars
  implicit none
  real b
 !$acc declare device_resident (b)
end module vars

program test
  use vars
  use openacc
  implicit none
  real a

  if (acc_is_present (b) .neqv. .true.) call abort

  a = 2.0

  !$acc parallel copy (a)
    b = a
    a = 1.0
    a = a + b
   !$acc end parallel

  if (acc_is_present (b) .neqv. .true.) call abort

  if (a .ne. 3.0) call abort

end program test