aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-06-19 00:14:14 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-06-19 00:14:14 +0200
commit6f7c1f65027e3372ce540398e55781f84bf575d3 (patch)
treecf478264aa4ea8333ed6d6c9fc9b5fbeada78dc5 /libgomp
parent5c9c7e19e63e0a6d9ed9e51601b4221f2fed5b13 (diff)
downloadgcc-6f7c1f65027e3372ce540398e55781f84bf575d3.zip
gcc-6f7c1f65027e3372ce540398e55781f84bf575d3.tar.gz
gcc-6f7c1f65027e3372ce540398e55781f84bf575d3.tar.bz2
[PR90861] Document status quo for OpenACC 'declare' not cleaning up for VLAs
gcc/testsuite/ PR testsuite/90861 * c-c++-common/goacc/declare-pr90861.c: New file. libgomp/ PR testsuite/90861 * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Update. From-SVN: r272446
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog3
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c47
2 files changed, 47 insertions, 3 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 06004aa..1a0d363 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,5 +1,8 @@
2019-06-18 Thomas Schwinge <thomas@codesourcery.com>
+ PR testsuite/90861
+ * testsuite/libgomp.oacc-c-c++-common/declare-vla.c: Update.
+
PR middle-end/90862
* testsuite/libgomp.oacc-c-c++-common/declare-1.c: Update.
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c
index 3ea148e..0f51bad 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/declare-vla.c
@@ -1,9 +1,10 @@
-/* Verify that acc declare accept VLA variables. */
+/* Verify OpenACC 'declare' with VLAs. */
#include <assert.h>
-int
-main ()
+
+void
+f (void)
{
int N = 1000;
int i, A[N];
@@ -20,6 +21,46 @@ main ()
for (i = 0; i < N; i++)
assert (A[i] == i);
+}
+
+
+/* The same as 'f' but everything contained in an OpenACC 'data' construct. */
+
+void
+f_data (void)
+{
+#pragma acc data
+ {
+ int N = 1000;
+ int i, A[N];
+# pragma acc declare copy(A)
+
+ for (i = 0; i < N; i++)
+ A[i] = -i;
+
+# pragma acc kernels
+ for (i = 0; i < N; i++)
+ A[i] = i;
+
+# pragma acc update host(A)
+
+ for (i = 0; i < N; i++)
+ assert (A[i] == i);
+ }
+}
+
+
+int
+main ()
+{
+ f ();
+
+ f_data ();
return 0;
}
+
+
+/* { dg-xfail-run-if "TODO PR90861" { *-*-* } { "-DACC_MEM_SHARED=0" } }
+ This might XPASS if the compiler happens to put the two 'A' VLAs at the same
+ address. */