diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2016-06-10 11:22:38 +0200 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gcc.gnu.org> | 2016-06-10 11:22:38 +0200 |
commit | 4b1ffdb16c4a54a4f8ad957143336e279b8d5c60 (patch) | |
tree | 094cd6874e2c2c5b7f80f6133130e32544a474c8 /libgomp | |
parent | 22d222d2401660d21b8d4f8f2a9b96cee9d852e7 (diff) | |
download | gcc-4b1ffdb16c4a54a4f8ad957143336e279b8d5c60.zip gcc-4b1ffdb16c4a54a4f8ad957143336e279b8d5c60.tar.gz gcc-4b1ffdb16c4a54a4f8ad957143336e279b8d5c60.tar.bz2 |
[PR c/71381] C/C++ OpenACC cache directive rejects valid syntax
gcc/c/
PR c/71381
* c-parser.c (c_parser_omp_variable_list) <OMP_CLAUSE__CACHE_>:
Loosen checking.
gcc/cp/
PR c/71381
* parser.c (cp_parser_omp_var_list_no_open) <OMP_CLAUSE__CACHE_>:
Loosen checking.
gcc/fortran/
PR c/71381
* openmp.c (gfc_match_oacc_cache): Add comment.
gcc/testsuite/
PR c/71381
* c-c++-common/goacc/cache-1.c: Update. Move invalid usage tests
to...
* c-c++-common/goacc/cache-2.c: ... this new file.
* gfortran.dg/goacc/cache-1.f95: Move invalid usage tests to...
* gfortran.dg/goacc/cache-2.f95: ... this new file.
* gfortran.dg/goacc/coarray.f95: Update OpenACC cache directive
usage.
* gfortran.dg/goacc/cray.f95: Likewise.
* gfortran.dg/goacc/loop-1.f95: Likewise.
libgomp/
PR c/71381
* testsuite/libgomp.oacc-c-c++-common/cache-1.c: #include
"../../../gcc/testsuite/c-c++-common/goacc/cache-1.c".
* testsuite/libgomp.oacc-fortran/cache-1.f95: New file.
gcc/
* omp-low.c (scan_sharing_clauses): Don't expect
OMP_CLAUSE__CACHE_.
From-SVN: r237290
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 7 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c | 49 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-fortran/cache-1.f95 | 6 |
3 files changed, 15 insertions, 47 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index f6d7dd2..5c7f41a 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,10 @@ +2016-06-10 Thomas Schwinge <thomas@codesourcery.com> + + PR c/71381 + * testsuite/libgomp.oacc-c-c++-common/cache-1.c: #include + "../../../gcc/testsuite/c-c++-common/goacc/cache-1.c". + * testsuite/libgomp.oacc-fortran/cache-1.f95: New file. + 2016-06-03 Chung-Lin Tang <cltang@codesourcery.com> * testsuite/libgomp.oacc-fortran/reduction-8.f90: New testcase. diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c index 3f1f0bb..16aaed5 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c @@ -1,48 +1,3 @@ -int -main (int argc, char **argv) -{ -#define N 2 - int a[N], b[N]; - int i; +/* OpenACC cache directive. */ - for (i = 0; i < N; i++) - { - a[i] = 3; - b[i] = 0; - } - -#pragma acc parallel copyin (a[0:N]) copyout (b[0:N]) -{ - int ii; - - for (ii = 0; ii < N; ii++) - { - const int idx = ii; - int n = 1; - const int len = n; - -#pragma acc cache (a[0:N]) - -#pragma acc cache (a[0:N], b[0:N]) - -#pragma acc cache (a[0]) - -#pragma acc cache (a[0], a[1], b[0:N]) - -#pragma acc cache (a[idx]) - -#pragma acc cache (a[idx:len]) - - b[ii] = a[ii]; - } -} - - - for (i = 0; i < N; i++) - { - if (a[i] != b[i]) - __builtin_abort (); - } - - return 0; -} +#include "../../../gcc/testsuite/c-c++-common/goacc/cache-1.c" diff --git a/libgomp/testsuite/libgomp.oacc-fortran/cache-1.f95 b/libgomp/testsuite/libgomp.oacc-fortran/cache-1.f95 new file mode 100644 index 0000000..37313d8 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-fortran/cache-1.f95 @@ -0,0 +1,6 @@ +! OpenACC cache directive. +! { dg-do run } +! { dg-additional-options "-std=f2008" } +! { dg-additional-options "-cpp" } + +#include "../../../gcc/testsuite/gfortran.dg/goacc/cache-1.f95" |