Hi Rainer,
> On 8 Jun 2026, at 10:28, Rainer Orth <[email protected]> wrote:
>> ---- implementation/design
>>
>> As noted, case 1 remains "you have to edit the tests to prepend _?
>> to symbols". Some tests in case 3 also need editing since the asm
>> for a PIC-only platform can differ significantly from statically-
>> linked.
>>
>> The strategy for automating a substantial part of the remainder
>> is:
>>
>> - Allow the target to skip some lines of the input regex (for
>> example, on Darwin we would skip .cfi_xxx since those insns
>> are not used at present).
>
> I've always wondered if those are actually necessary in the general
> case. Judging from the aarch64 tests using check-function-bodies, only
> 24 out of almost 5000 actually check for them. I strongly suspect they
> are only present on x86 because they are included on Linux/x86 in the
> default assembler output.
That’s my guess too..
*** perhaps future reviews could ask about the content of this kind of test. ***
However, right now my goal is to minimise the number of tests that have
to be edited to accommodate a new sub-port.
TBH aarch64 tests are the ones I care most about (since currently changes
to tests are the largest part of the darwin port).
>> ---- TODO:
> [...]
>> 2. I wonder if we can make some cases more efficient by allowing
>> more that one start key for the reg-exes, thus:
>>
>> /* { dg-final { check-function-bodies {"**" "*E"} "" "" { target { !
>> *-*-darwin* } } {^\t?\.} } } */
>> /* { dg-final { check-function-bodies {"**" "*M"} "" "" { target *-*-darwin*
>> } {^\t?\.} } } */
>>
>> /*
>> **foo:
>> **...
>> *E elf asm
>> ** asm that's the same for both
>> *M mach-o asm
>> **...
>> */
>
> Nice.
thanks (however, I did not implement it yet).
> I wonder if we couldn't move this into check-function-bodies
> itself. Besides, right now out of 8128 instances of
> check-function-bodies the vast majority uses "**". Only 28 tests (a
> subset of the nvptx ones) use "** " instead, which could easily be
> changed to the common form. This way, the PREFIX argument could just go
> in the tests themselves.
>
> I also wonder if we could do away with the second arg (TERMINATOR)? It
> is uses in exactly one test out of 8000+. This would further improve
> readability.
I am not (yet) persuaded on these points - despite being very keen to
minimise what needs to appear in the dg- clauses.
If you look at the changes in patches 3 and 4 - you will see that there are
cases where effectively I needed to make a second regex block for Darwin.
If we made ** an implicit start that would perhaps make this type of action
harder rather than easier (maybe consider the jury to be out on this so far).
In order to support multiple regex blocks I think we’d need to keep the ability
to have distinct terminators.
Open to suggestions of course...
>> 3. I note that the 5th entry in the dg- command seems to be {^\t?\.} in
>> the vast number of cases, perhaps this should be moved into the code?
>
> This arg is only used rarely used (165 out of 8000+). I doubt this is
> worth the effort.
ISTM that the x86 tests differ significantly from the aarch64 ones - in that
they
seem to make much more recognition of label positions, perhaps that is also
because they seem to be much closer to raw asm output.
Iain
P.S. I am also testing the changes on the aarch64-darwin port, but obv. that’s
not in any way official yet.
>
> Rainer
>
> --
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University