Hi!
On Fri, Sep 02, 2022 at 11:43:28AM +0800, HAO CHEN GUI wrote:
> On 2/9/2022 上午 12:07, Segher Boessenkool wrote:
> >> +/* { dg-do compile { target { ! has_arch_pwr9 } } } */
> > Please keep dg-do first thing in the file.
> Could you inform me if it's a must to put dg-do in the first line?
It is customary. If you do differently it will be a lot harder for
people to truly understand your tests.
> Here I hit a problem. "! has_arch_pwr9" can not be put into
> dg-require-effective-target as it has a NOT.
dg-require-effective-target has a selector, maybe you can do something
with that?
dg-require-effective-target { whatever { has_arch_pwr9 } }
or something like that?
> >> --- a/gcc/testsuite/gcc.target/powerpc/pr93453-1.c
> >> +++ b/gcc/testsuite/gcc.target/powerpc/pr93453-1.c
> >> @@ -1,5 +1,6 @@
> >> -/* { dg-do compile { target has_arch_ppc64 } } */
> >> +/* { dg-do compile } */
> >> /* { dg-options "-mdejagnu-cpu=power6 -O2" } */
> >> +/* { dg-require-effective-target has_arch_ppc64 } */
> > This is fine, but it doesn't change anything, unless we have a bug.
>
> This case suffer from "empty translation unit" problem and to be
> unsupported on all platform. Put dg-options before the check avoid
> the problem.
Then please fix that problem first! It *will* come back to bite us,
multiple times per week, until it is fixed.
Segher