aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authoryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-12 09:21:29 +0000
committeryroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-12 09:21:29 +0000
commit63dc2c79b27279192c4aec9bb077791aa4ab3711 (patch)
treeccc93f8d30a71079084573174eb2873e2cceca7c /libgomp
parent28e5452567fd6edfe26d134971c10b6776e54ef6 (diff)
Merge branches/gcc-4_9-branch rev 220524
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220638 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.c/pr64734.c55
2 files changed, 60 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 0c5042774e9..81c62da380b 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/64734
+ * libgomp.c/pr64734.c: New test.
+
2014-12-03 Uros Bizjak <ubizjak@gmail.com>
* configure.tgt (x86_64-*-linux*): Tune -m32 multilib to generic.
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;
+}