view gcc/testsuite/c-c++-common/goacc/declare-pr94120.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

/* { 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;
  }
}