From: Cesar Philippidis Date: Tue, 18 Jun 2019 22:14:34 +0000 (-0700) Subject: Add 'libgomp.oacc-fortran/allocatable-array-1.f90' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6652161ef3293e7c9d3ed6690a3e1c869424185f;p=gcc.git Add 'libgomp.oacc-fortran/allocatable-array-1.f90' libgomp/ * testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New file. From-SVN: r272448 --- diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 62c45828a00..bd57e38ce19 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-06-18 Cesar Philippidis + + * testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New + file. + 2019-06-18 Thomas Schwinge PR fortran/90743 diff --git a/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90 new file mode 100644 index 00000000000..c9a76385d9f --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90 @@ -0,0 +1,27 @@ +! { dg-do run } + +program main + integer, parameter :: n = 40 + integer, allocatable :: ar(:,:,:) + integer :: i + + allocate (ar(1:n,0:n-1,0:n-1)) + !$acc enter data copyin (ar) + + !$acc update host (ar) + + !$acc update device (ar) + + call update_ar (ar, n) + + !$acc exit data copyout (ar) +end program main + +subroutine update_ar (ar, n) + integer :: n + integer, dimension (1:n,0:n-1,0:n-1) :: ar + + !$acc update host (ar) + + !$acc update device (ar) +end subroutine update_ar