aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorChung-Lin Tang <cltang@codesourcery.com>2016-08-14 18:19:10 +0000
committerChung-Lin Tang <cltang@gcc.gnu.org>2016-08-14 18:19:10 +0000
commit7c7137142cf89bd7f5aba0b8fa829852f8b8bd94 (patch)
tree670bf5a89694b2fc6c21a4f52a1aae8f2634f51a /libgomp/testsuite
parentc42b0bdf2f3d22167ed6d66a249d0d7c77a672b1 (diff)
downloadgcc-7c7137142cf89bd7f5aba0b8fa829852f8b8bd94.zip
gcc-7c7137142cf89bd7f5aba0b8fa829852f8b8bd94.tar.gz
gcc-7c7137142cf89bd7f5aba0b8fa829852f8b8bd94.tar.bz2
re PR fortran/70598 (Fortran OpenACC host_data construct ICE)
2016-08-14 Chung-Lin Tang <cltang@codesourcery.com> PR fortran/70598 gcc/fortran/ * openmp.c (resolve_omp_clauses): Adjust use_device clause handling to only allow pointers and arrays. gcc/testsuite/ * gfortran.dg/goacc/host_data-tree.f95: Adjust to use pointers in use_device clause. * gfortran.dg/goacc/uninit-use-device-clause.f95: Likewise. * gfortran.dg/goacc/list.f95: Adjust to catch "neither a POINTER nor an array" error messages. libgomp/ * testsuite/libgomp.oacc-fortran/host_data-1.f90: New test. From-SVN: r239457
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.oacc-fortran/host_data-1.f9032
1 files changed, 32 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/host_data-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/host_data-1.f90
new file mode 100644
index 0000000..69a491d
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-fortran/host_data-1.f90
@@ -0,0 +1,32 @@
+! { dg-do run }
+! { dg-additional-options "-cpp" }
+
+program test
+ implicit none
+
+ integer, target :: i, arr(1000)
+ integer, pointer :: ip, iph
+ integer, contiguous, pointer :: parr(:), parrh(:)
+
+ ! Assign the same targets
+ ip => i
+ parr => arr
+ iph => i
+ parrh => arr
+
+ !$acc data copyin(i, arr)
+ !$acc host_data use_device(ip, parr)
+
+ ! Test how the pointers compare inside a host_data construct
+#if ACC_MEM_SHARED
+ if (.not. associated(ip, iph)) call abort
+ if (.not. associated(parr, parrh)) call abort
+#else
+ if (associated(ip, iph)) call abort
+ if (associated(parr, parrh)) call abort
+#endif
+
+ !$acc end host_data
+ !$acc end data
+
+end program test