summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorCesar Philippidis <cesar@codesourcery.com>2016-07-15 07:13:48 -0700
committerCesar Philippidis <cesar@gcc.gnu.org>2016-07-15 07:13:48 -0700
commitb1c9c068f75c6763c0c6d1f1973e1b95f148feb7 (patch)
tree24f214bc9201f4e69ce3b4eb462e9c4ce97cfc09 /libgomp
parentf7ba880b6b4b1c9d7437889204cac5df0268d158 (diff)
downloadgcc-b1c9c068f75c6763c0c6d1f1973e1b95f148feb7.tar.gz
c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER.
gcc/c/ * c-parser.c (c_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. * c-typeck.c (handle_omp_array_sections): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. gcc/cp/ * parser.c (cp_parser_oacc_declare): Don't scan for GOMP_MAP_POINTER. * semantics.c (handle_omp_array_sections): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. gcc/ * omp-low.c (lower_omp_target): Mark data clauses with GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} as potentially having zero-length subarrays. libgomp/ * testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c: New test. From-SVN: r238376
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c45
2 files changed, 50 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 35e29c06776..e4555eacd2d 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c: New
+ test.
+
2016-07-03 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/71734
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c
new file mode 100644
index 00000000000..8954551205b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/zero_length_subarrays.c
@@ -0,0 +1,45 @@
+/* Exercise zero-length sub-arrays. */
+
+const int n = 10;
+
+void
+subzero_present (int *a, int n)
+{
+#pragma acc data present (a[0:n])
+ ;
+#pragma acc data pcopy (a[0:n])
+ ;
+#pragma acc data pcopyin (a[0:n])
+ ;
+#pragma acc data pcopyout (a[0:n])
+ ;
+
+}
+
+void
+subzero (int *a, int n)
+{
+#pragma acc data create (a[0:n])
+ ;
+#pragma acc data copy (a[0:n])
+ ;
+#pragma acc data copyin (a[0:n])
+ ;
+#pragma acc data copyout (a[0:n])
+ ;
+}
+
+int
+main ()
+{
+ int a[n];
+
+#pragma acc data copy (a[0:n])
+ {
+ subzero_present (a, 0);
+ }
+
+ subzero (a, 0);
+
+ return 0;
+}