]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add 'libgomp.oacc-fortran/allocatable-array-1.f90'
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 22:14:34 +0000 (22:14 +0000)
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Jun 2019 22:14:34 +0000 (22:14 +0000)
libgomp/
* testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New
file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272448 138bc75d-0d04-0410-961f-82ee72b054a4

libgomp/ChangeLog
libgomp/testsuite/libgomp.oacc-fortran/allocatable-array-1.f90 [new file with mode: 0644]

index 62c45828a009386eefa65cd0602694913643b772..bd57e38ce19a9876bf5f8cee40e3d08f11b8da6a 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-18  Cesar Philippidis  <cesar@codesourcery.com>
+
+       * testsuite/libgomp.oacc-fortran/allocatable-array-1.f90: New
+       file.
+
 2019-06-18  Thomas Schwinge  <thomas@codesourcery.com>
 
        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 (file)
index 0000000..c9a7638
--- /dev/null
@@ -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