Hi Rainer,

> On 16 Jun 2026, at 09:10, Rainer Orth <[email protected]> wrote:

>> Tested on aarch64-darwin (and testing now on aarch64-linux),
>> OK for trunk (assuming the Linux tests pass)?
> 
> as I've said before, I very much like the syntax, but ...
> 
>> The motivation for this is that it is not unusal for subtargets to have
>> substantially equivalent code-gen but differing in details.  This provision
>> avoid duplication of the common sections.
>> 
>> Viz:
>> // { dg-final { check-function-bodies {"**" "*E"} "*/" "" { target { ! 
>> *-*-darwin* } } {\.L[0-9]+} } }
>> // { dg-final { check-function-bodies {"**" "*M"} "*/" "" { target 
>> *-*-darwin* } {\.L[0-9]+} } }
> 
> ... this is going the wrong direction IMO: this will be duplicated into
> every test that needs different prefixes.  The testsuite is already
> riddled with such duplication, and I'd rather see it reduced than
> increase it.
> 
>> This says that body scan lines can begin with either ** or *E for ELF targets
>> (or pecoff, I guess)
>> but that Darwin targets should scan for either ** or *M.
> 
> Imagine (which I think is plausible) that PE-COFF support is really
> added: this would make the default (ELF) case ever harder to read, apart
> from having to modify this section in every single test involved.
> 
> If the multiple prefix support were moved into check-function-bodies
> instead, all this would simply vanish, improving both readability and
> maintainablity.  Witness Richard's change to patch to move the explicit
> dg-add-options check_function_bodies into dg-final.

I agree with all of this, in principle;
 my residual objections are:
 - it means that the process of adding a change to deal with a new test
   granularity now means editing a file in testsuite/lib instead of making a
   change local to one specific test.
 - it hides the meaning of the prefixes away outside the actual test (meaning
   that one has to look in two places to understand the intent).
 - We will probably still have cases where the code-gen is so dissimilar between
   targets that multiple match blocks would be needed.  I’d done that so far 
with
  a different terminator for each case .. but perhaps it would work just 
retaining
  ‘*/‘ at the expense of a little less readability of the match blocks.

that said, none ot those are show-stoppers for me …

> I also think that this is doable without too much churn:
> 
> * Move the functionality into check-function-bodies, always applying it.
> 
> * Given that only some of the AVR tests (28 total) use a prefix other
>  than "**" ("** ") for some unknown reason, change those tests to also
>  use "**" like everyone else.

well, I’d guess that just means adding “** “ to the config content for avr.

> * Then, in check-function-bodies the explicit PREFIX arg can simply be
>  ignored (or rather checked that that it's "**" as in all tests so
>  far) and replaced by the magic above.
> 
> I think this would be a large win for everyone with manageable
> complexity.

Sure, I don’t think that the change to the patch is a big deal - it’s just a
question of how we want it to look to the end-user (who is perhaps not
so quick to want to edit the core testsuite code).

thanks
Iain

> 
> As a follow-up, mostly mechanical, one could remove the explicit PREFIX
> from the tests, relying on the default instead.
> 
> Thoughts?  I'd especially like Mike's and Richard's opinions on this.
> 
> Rainer
> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to