Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / goacc / declare-pr94120.C
blob7aa56121e38bd8863a17a7904402c71877f4b960
1 /* { dg-do compile }  */
3 /* PR middle-end/94120  */
5 int b[8];
6 #pragma acc declare create (b)
7  
8 namespace my {
9  int d[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
10  #pragma acc declare copyin (d)
13 namespace outer {
14   namespace inner {
15     int e[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
16     #pragma acc declare copyin (e)
17   }
20 int f[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
21 namespace my {
22  #pragma acc declare copyin (f)         /* { dg-error "'f' must be a variable declared in the same scope as '#pragma acc declare'" }  */
25 namespace outer {
26   int g[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
27   namespace inner {
28     #pragma acc declare copyin (g)      /* { dg-error "'outer::g' must be a variable declared in the same scope as '#pragma acc declare'" }  */
29   }