diff mbox series

[committed] openacc: Fix up declare-pr94120.C testcase [PR94533]

Message ID 20200408175750.GJ2212@tucnak
State New
Headers show
Series [committed] openacc: Fix up declare-pr94120.C testcase [PR94533] | expand

Commit Message

Li, Pan2 via Gcc-patches April 8, 2020, 5:57 p.m. UTC
Hi!

On Wed, Mar 11, 2020 at 02:28:44PM +0100, Tobias Burnus wrote:
> 	gcc/testsuite/
> 	PR middle-end/94120
> 	* c-c++-common/goacc/declare-pr94120.c: New.
> 	* g++.dg/declare-pr94120.C: New.

This test has been put in a wrong directory, where OpenACC tests aren't
tested with -fopenacc, and also contained trailing semicolons.
I've moved it where it belongs, added dg-error directives and removed
the extra semicolons.

Tested on x86_64-linux, committed to trunk as obvious.

2020-04-08  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/94120
	PR testsuite/94533
	* g++.dg/declare-pr94120.C: Move test to ...
	* g++.dg/goacc/declare-pr94120.C: ... here.  Add dg-error directives.
	Remove semicolons after } at the end of namespaces.



	Jakub
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/declare-pr94120.C b/gcc/testsuite/g++.dg/goacc/declare-pr94120.C
similarity index 60%
rename from gcc/testsuite/g++.dg/declare-pr94120.C
rename to gcc/testsuite/g++.dg/goacc/declare-pr94120.C
index 8515c4ff875..7aa56121e38 100644
--- a/gcc/testsuite/g++.dg/declare-pr94120.C
+++ b/gcc/testsuite/g++.dg/goacc/declare-pr94120.C
@@ -8,23 +8,23 @@  int b[8];
 namespace my {
  int d[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
  #pragma acc declare copyin (d)
-};
+}
 
 namespace outer {
   namespace inner {
     int e[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
     #pragma acc declare copyin (e)
-  };
-};
+  }
+}
 
 int f[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
 namespace my {
- #pragma acc declare copyin (f)
-};
+ #pragma acc declare copyin (f)		/* { dg-error "'f' must be a variable declared in the same scope as '#pragma acc declare'" }  */
+}
 
 namespace outer {
   int g[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
   namespace inner {
-    #pragma acc declare copyin (g)
-  };
-};
+    #pragma acc declare copyin (g)	/* { dg-error "'outer::g' must be a variable declared in the same scope as '#pragma acc declare'" }  */
+  }
+}