aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/goacc/declare-pr94120.c
blob: 21b2cc14fc79c62811f137acc6d3ce2565b78ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile }  */

/* PR middle-end/94120  */

void foo()
{
  int foo;
  {
    #pragma acc declare copy(foo)  /* { dg-error "'foo' must be a variable declared in the same scope as '#pragma acc declare'" }  */
  }
}

void
f_data (void)
{
  int B[10];
#pragma acc data
  {
# pragma acc declare copy(B)  /* { dg-error "'B' must be a variable declared in the same scope as '#pragma acc declare'" }  */
    for (int i = 0; i < 10; i++)
      B[i] = -i;
  }
}