From: Jakub Jelinek Date: Wed, 8 Apr 2020 17:54:35 +0000 (+0200) Subject: openacc: Fix up declare-pr94120.C testcase [PR94533] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08d1e7a5aabcf7eeac48bfd99deb80451b8f9974;p=gcc.git openacc: Fix up declare-pr94120.C testcase [PR94533] 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. 2020-04-08 Jakub Jelinek 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. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ed51141ac2..dcf552f2a03 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2020-04-08 Jakub Jelinek + + 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. + 2020-04-08 Marek Polacek PR c++/94507 - ICE-on-invalid with lambda template. diff --git a/gcc/testsuite/g++.dg/declare-pr94120.C b/gcc/testsuite/g++.dg/declare-pr94120.C deleted file mode 100644 index 8515c4ff875..00000000000 --- a/gcc/testsuite/g++.dg/declare-pr94120.C +++ /dev/null @@ -1,30 +0,0 @@ -/* { dg-do compile } */ - -/* PR middle-end/94120 */ - -int b[8]; -#pragma acc declare create (b) - -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) -}; - -namespace outer { - int g[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; - namespace inner { - #pragma acc declare copyin (g) - }; -}; diff --git a/gcc/testsuite/g++.dg/goacc/declare-pr94120.C b/gcc/testsuite/g++.dg/goacc/declare-pr94120.C new file mode 100644 index 00000000000..7aa56121e38 --- /dev/null +++ b/gcc/testsuite/g++.dg/goacc/declare-pr94120.C @@ -0,0 +1,30 @@ +/* { dg-do compile } */ + +/* PR middle-end/94120 */ + +int b[8]; +#pragma acc declare create (b) + +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) /* { 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) /* { dg-error "'outer::g' must be a variable declared in the same scope as '#pragma acc declare'" } */ + } +}