Hi! On Wed, 05 Nov 2014 17:29:19 +0100, I wrote: > In r217145, I applied Jim's patch to gomp-4_0-branch:
> * testsuite/libgomp.oacc-c/cache-1.c: New file.
> * testsuite/libgomp.oacc-c++/cache-1.C: Likewise.
Applied to gomp-4_0-branch in r217147:
commit 267cffc4105255a8372fb5788fdcbb54560f493b
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed Nov 5 16:46:23 2014 +0000
Testing of C/C++ OpenACC cache directive.
gcc/testsuite/
* c-c++-common/goacc/cache-1.c: New file.
libgomp/
* testsuite/libgomp.oacc-c/cache-1.c: Remove directives that are
expected to fail, and rename the file to...
* testsuite/libgomp.oacc-c-c++-common/cache-1.c: ... this.
* testsuite/libgomp.oacc-c++/cache-1.C: Remove file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@217147
138bc75d-0d04-0410-961f-82ee72b054a4
---
gcc/testsuite/ChangeLog.gomp | 2 +
gcc/testsuite/c-c++-common/goacc/cache-1.c | 88 ++++++++++++++++++++++
libgomp/ChangeLog.gomp | 7 ++
libgomp/testsuite/libgomp.oacc-c++/cache-1.C | 50 ------------
.../testsuite/libgomp.oacc-c-c++-common/cache-1.c | 48 ++++++++++++
libgomp/testsuite/libgomp.oacc-c/cache-1.c | 69 -----------------
6 files changed, 145 insertions(+), 119 deletions(-)
diff --git gcc/testsuite/ChangeLog.gomp gcc/testsuite/ChangeLog.gomp
index 25be821..1faf0fa 100644
--- gcc/testsuite/ChangeLog.gomp
+++ gcc/testsuite/ChangeLog.gomp
@@ -1,5 +1,7 @@
2014-11-05 Thomas Schwinge <[email protected]>
+ * c-c++-common/goacc/cache-1.c: New file.
+
* gfortran.dg/goacc/data-tree.f95: Remove dg-prune-output directive.
* gfortran.dg/goacc/kernels-tree.f95: Likewise.
* gfortran.dg/goacc/loop-tree-1.f90: Likewise.
diff --git gcc/testsuite/c-c++-common/goacc/cache-1.c
gcc/testsuite/c-c++-common/goacc/cache-1.c
new file mode 100644
index 0000000..9503341
--- /dev/null
+++ gcc/testsuite/c-c++-common/goacc/cache-1.c
@@ -0,0 +1,88 @@
+int
+main (int argc, char **argv)
+{
+#define N 2
+ int a[N], b[N];
+ int i;
+
+ 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 /* { dg-error "expected '\\\(' before end of line" } */
+
+#pragma acc cache a[0:N] /* { dg-error "expected '\\\(' before 'a'" } */
+ /* { dg-bogus "expected end of line before 'a'" "" { xfail c++ } 26 } */
+
+#pragma acc cache (a) /* { dg-error "expected '\\\['" } */
+
+#pragma acc cache ( /* { dg-error "expected (identifier|unqualified-id) before
end of line" } */
+
+#pragma acc cache () /* { dg-error "expected (identifier|unqualified-id)
before '\\\)' token" } */
+
+#pragma acc cache (,) /* { dg-error "expected (identifier|unqualified-id)
before '(,|\\\))' token" } */
+
+#pragma acc cache (a[0:N] /* { dg-error "expected '\\\)' before end of line" }
*/
+
+#pragma acc cache (a[0:N],) /* { dg-error "expected
(identifier|unqualified-id) before '(,|\\\))' token" "" { xfail c } } */
+
+#pragma acc cache (a[0:N]) copyin (a[0:N]) /* { dg-error "expected end of line
before 'copyin'" } */
+
+#pragma acc cache () /* { dg-error "expected (identifier|unqualified-id)
before '\\\)' token" } */
+
+#pragma acc cache (a[0:N] b[0:N]) /* { dg-error "expected '\\\)' before 'b'" }
*/
+
+#pragma acc cache (a[0:N] b[0:N}) /* { dg-error "expected '\\\)' before 'b'" }
*/
+ /* { dg-bogus "expected end of line before '\\\}' token" "" { xfail c++
} 47 } */
+
+#pragma acc cache (a[0:N] /* { dg-error "expected '\\\)' before end of line" }
*/
+
+#pragma acc cache (a[ii]) /* { dg-error "'ii' is not a constant" } */
+
+#pragma acc cache (a[idx:n]) /* { dg-error "'n' is not a constant" } */
+
+#pragma acc cache (a[0:N]) ( /* { dg-error "expected end of line before '\\('
token" } */
+
+#pragma acc cache (a[0:N]) ii /* { dg-error "expected end of line before 'ii'"
} */
+
+#pragma acc cache (a[0:N] ii) /* { dg-error "expected '\\)' before 'ii'" } */
+
+#pragma acc cache (a[0:N])
+
+#pragma acc cache (a[0:N], 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;
+}
diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 4ac348d..096a2a9 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,10 @@
+2014-11-05 Thomas Schwinge <[email protected]>
+
+ * testsuite/libgomp.oacc-c/cache-1.c: Remove directives that are
+ expected to fail, and rename the file to...
+ * testsuite/libgomp.oacc-c-c++-common/cache-1.c: ... this.
+ * testsuite/libgomp.oacc-c++/cache-1.C: Remove file.
+
2014-11-05 James Norris <[email protected]>
* testsuite/libgomp.oacc-c/cache-1.c: New file.
diff --git libgomp/testsuite/libgomp.oacc-c++/cache-1.C
libgomp/testsuite/libgomp.oacc-c++/cache-1.C
deleted file mode 100644
index eb94a68..0000000
--- libgomp/testsuite/libgomp.oacc-c++/cache-1.C
+++ /dev/null
@@ -1,50 +0,0 @@
-/* { dg-do compile } */
-
-#include <stdlib.h>
-
-int
-main (int argc, char **argv)
-{
-#define N 2
- int a[N], b[N];
- int i;
-
- 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 /* { dg-error "error: expected '\\(' before end of line" } */
-
-#pragma acc cache (a) /* { dg-error "error: expected '\\\['" } */
-
-#pragma acc cache (a[0:N]) copyin (a[0:N]) /* { dg-error "error: expected end
of line before 'copyin'" } */
-
-#pragma acc cache () /* { dg-error "error: expected unqualified-id before
'\\)' token" } */
-
-#pragma acc cache (a[0:N] b[0:N}) /* { dg-error "error: expected end of line
before '\\\}' token|error: expected '\\)' before 'b'" } */
-
- b[ii] = a[ii];
- }
-}
-
-
- for (i = 0; i < N; i++)
- {
- if (a[i] != b[i])
- abort ();
- }
-
- return 0;
-}
diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c
new file mode 100644
index 0000000..3f1f0bb
--- /dev/null
+++ libgomp/testsuite/libgomp.oacc-c-c++-common/cache-1.c
@@ -0,0 +1,48 @@
+int
+main (int argc, char **argv)
+{
+#define N 2
+ int a[N], b[N];
+ int i;
+
+ 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;
+}
diff --git libgomp/testsuite/libgomp.oacc-c/cache-1.c
libgomp/testsuite/libgomp.oacc-c/cache-1.c
deleted file mode 100644
index 5473475..0000000
--- libgomp/testsuite/libgomp.oacc-c/cache-1.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* { dg-do compile } */
-
-#include <openacc.h>
-#include <stdlib.h>
-
-int
-main (int argc, char **argv)
-{
-#define N 2
- int a[N], b[N];
- int i;
-
- 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 /* { dg-error "error: expected '\\(' before end of line" } */
-
-#pragma acc cache (a) /* { dg-error "error: expected '\\\[' before '\\)'
token" } */
-
-#pragma acc cache (a[0:N]) copyin (a[0:N]) /* { dg-error "error: expected end
of line before 'copyin'" } */
-
-#pragma acc cache () /* { dg-error "error: expected identifier before '\\)'
token" } */
-
-#pragma acc cache (a[0:N] b[0:N}) /* { dg-error "error: expected '\\)' before
'b'" } */
-
-#pragma acc cache (a[0:N] /* { dg-error "error: expected '\\)' before end of
line" } */
-
-#pragma acc cache (a[ii]) /* { dg-error "error: 'ii' is not a constant" } */
-
-#pragma acc cache (a[idx:n]) /* { dg-error "error: 'n' is not a constant" } */
-
-#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])
- abort ();
- }
-
- return 0;
-}
Grüße,
Thomas
pgpeuhI60dHoz.pgp
Description: PGP signature
