gcc/libgomp/testsuite/libgomp.oacc-fortran/deep-copy-8.f90
Julian Brown 02817027ca OpenACC 2.6 deep copy: Fortran execution tests
libgomp/
	* testsuite/libgomp.oacc-fortran/deep-copy-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-2.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-3.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-4.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-5.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-6.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-7.f90: New test.
	* testsuite/libgomp.oacc-fortran/deep-copy-8.f90: New test.
	* testsuite/libgomp.oacc-fortran/derived-type-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/derivedtype-1.f95: New test.
	* testsuite/libgomp.oacc-fortran/derivedtype-2.f95: New test.
	* testsuite/libgomp.oacc-fortran/multidim-slice.f95: New test.
	* testsuite/libgomp.oacc-fortran/update-2.f90: New test.

Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>

From-SVN: r279630
2019-12-20 01:39:46 +00:00

42 lines
706 B
Fortran

! { dg-do run }
! Test of explicit attach/detach clauses and attachment counters. There are no
! acc_attach/acc_detach API routines in Fortran.
program dtype
use openacc
implicit none
integer, parameter :: n = 512
type mytype
integer, allocatable :: a(:)
end type mytype
integer i
type(mytype) :: var
allocate(var%a(1:n))
call acc_copyin(var)
call acc_copyin(var%a)
!$acc enter data attach(var%a)
!$acc parallel loop attach(var%a)
do i = 1,n
var%a(i) = i
end do
!$acc end parallel loop
!$acc exit data detach(var%a)
call acc_copyout(var%a)
call acc_copyout(var)
do i = 1,n
if (i .ne. var%a(i)) stop 1
end do
deallocate(var%a)
end program dtype