Retro68/gcc/libgomp/testsuite/libgomp.oacc-fortran/declare-4.f90

30 lines
396 B
Fortran
Raw Normal View History

2018-12-28 15:30:48 +00:00
! { dg-do run }
2017-04-10 11:32:00 +00:00
module vars
implicit none
real b
!$acc declare create (b)
end module vars
program test
use vars
use openacc
implicit none
real a
2018-12-28 15:30:48 +00:00
if (acc_is_present (b) .neqv. .true.) STOP 1
2017-04-10 11:32:00 +00:00
a = 2.0
!$acc parallel copy (a)
b = a
a = 1.0
a = a + b
!$acc end parallel
2018-12-28 15:30:48 +00:00
if (acc_is_present (b) .neqv. .true.) STOP 2
2017-04-10 11:32:00 +00:00
2018-12-28 15:30:48 +00:00
if (a .ne. 3.0) STOP 3
2017-04-10 11:32:00 +00:00
end program test