aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-01-23 18:19:50 +0000
committerJakub Jelinek <jakub@redhat.com>2015-01-23 18:19:50 +0000
commitdc6b85818f9d3bd4e70910278e1223f9c16eec41 (patch)
tree0b4fd08fad396211399dfe9c28d88e7ec0ed0eab /libgomp/testsuite/libgomp.c
parentc88757b9bb5d0781a46bbf8b18a19164616f2d87 (diff)
PR middle-end/64734
* omp-low.c (scan_sharing_clauses): Don't ignore OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION GOMP_MAP_POINTER clauses on target data/update constructs. * libgomp.c/pr64734.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@220053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r--libgomp/testsuite/libgomp.c/pr64734.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/pr64734.c b/libgomp/testsuite/libgomp.c/pr64734.c
new file mode 100644
index 00000000000..457f481ae0b
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr64734.c
@@ -0,0 +1,55 @@
+/* PR middle-end/64734 */
+
+#include <stdlib.h>
+
+void
+foo (int *x, int *y)
+{
+ #pragma omp target map (alloc:x[0]) map (alloc:y[0:8])
+ {
+ int i;
+ for (i = 0; i < 8; i++)
+ if (y[i] != 2 + i)
+ break;
+ if (i != 8 || *x != 1)
+ *x = 6;
+ else
+ {
+ *x = 8;
+ for (i = 0; i < 8; i++)
+ y[i] = 9 + i;
+ }
+ }
+ #pragma omp target update from (y[0:8]) from (x[0])
+}
+
+void
+bar (void)
+{
+ int x = 1, y[32] = { 0 };
+ #pragma omp target data map (to:y[0:32]) map (to:x)
+ ;
+}
+
+int
+main ()
+{
+ int x = 1, y[8] = { 2, 3, 4, 5, 6, 7, 8, 9 }, i;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ ;
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ {
+ #pragma omp target update from (y[0:8]) from (x)
+ }
+
+ #pragma omp target data map (to:y[0:8]) map (to:x)
+ foo (&x, &y[0]);
+
+ if (x != 8)
+ abort ();
+ for (i = 0; i < 8; i++)
+ if (y[i] != 9 + i)
+ abort ();
+
+ return 0;
+}