@@ -1,5 +1,7 @@
2014-11-05 Thomas Schwinge <thomas@codesourcery.com>
+ * 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.
new file mode 100644
@@ -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;
+}
@@ -1,3 +1,10 @@
+2014-11-05 Thomas Schwinge <thomas@codesourcery.com>
+
+ * 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 <jnorris@codesourcery.com>
* testsuite/libgomp.oacc-c/cache-1.c: New file.
deleted file mode 100644
@@ -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;
-}
new file mode 100644
@@ -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;
+}
deleted file mode 100644
@@ -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;
-}