gcc/libgomp/testsuite/libgomp.oacc-fortran/attach-descriptor-2.f90
Julian Brown 39dda00208 openacc: Fix standalone attach for Fortran assumed-shape array pointers
This patch makes it so that an "attach" operation for a Fortran pointer
with an array descriptor copies that array descriptor to the target,
and similarly that detach operations release the array descriptor.

2020-07-16  Julian Brown  <julian@codesourcery.com>
	    Thomas Schwinge  <thomas@codesourcery.com>

gcc/fortran/
	* trans-openmp.c (gfc_trans_omp_clauses): Rework OpenACC
	attach/detach handling for arrays with descriptors.

gcc/testsuite/
	* gfortran.dg/goacc/attach-descriptor.f90: New test.

libgomp/
	* testsuite/libgomp.oacc-fortran/attach-descriptor-1.f90: New test.
	* testsuite/libgomp.oacc-fortran/attach-descriptor-2.f90: New test.

Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
2020-07-16 14:12:53 -07:00

19 lines
465 B
Fortran

! { dg-do run }
program main
use openacc
implicit none
! TODO Per PR96080, data types chosen so that we can create a
! "pointer object 'data_p'" on the device.
integer, dimension(:), target :: data(1)
integer, dimension(:), pointer :: data_p
!TODO Per PR96080, not using OpenACC/Fortran runtime library routines.
!$acc enter data create(data)
data_p => data
!$acc enter data copyin(data_p)
!$acc enter data attach(data_p)
end program main