aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-07-26 18:12:02 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-07-26 18:12:02 +0200
commit5883c5ccc9339a2cbce7754179bed7279d98d4aa (patch)
treeaeea1b4aee66b98c517921562febedce95453201 /libgomp/testsuite/libgomp.c
parentc83b4b824214039fea696083e6a888aa7c9063ce (diff)
downloadgcc-5883c5ccc9339a2cbce7754179bed7279d98d4aa.zip
gcc-5883c5ccc9339a2cbce7754179bed7279d98d4aa.tar.gz
gcc-5883c5ccc9339a2cbce7754179bed7279d98d4aa.tar.bz2
re PR middle-end/86660 (libgomp.c++/for-15.C ICEs with nvptx offloading)
PR middle-end/86660 * omp-low.c (scan_sharing_clauses): Don't ignore map clauses for declare target to variables if they have always,{to,from,tofrom} map kinds. * testsuite/libgomp.c/pr86660.c: New test. From-SVN: r263010
Diffstat (limited to 'libgomp/testsuite/libgomp.c')
-rw-r--r--libgomp/testsuite/libgomp.c/pr86660.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/pr86660.c b/libgomp/testsuite/libgomp.c/pr86660.c
new file mode 100644
index 0000000..bea6b15
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr86660.c
@@ -0,0 +1,28 @@
+/* PR middle-end/86660 */
+
+#pragma omp declare target
+int v[20];
+
+void
+foo (void)
+{
+ if (v[7] != 2)
+ __builtin_abort ();
+ v[7] = 1;
+}
+#pragma omp end declare target
+
+int
+main ()
+{
+ v[5] = 8;
+ v[7] = 2;
+ #pragma omp target map (always, tofrom: v)
+ {
+ foo ();
+ v[5] = 3;
+ }
+ if (v[7] != 1 || v[5] != 3)
+ __builtin_abort ();
+ return 0;
+}