On Mon, Jan 26, 2026 at 7:04 AM Karl Meakin <[email protected]> wrote:
>
> On 23/01/2026 20:06, Andrew Pinski wrote:
> > On Fri, Jan 23, 2026 at 11:15 AM Karl Meakin <[email protected]> wrote:
> >> The tests for `+cmpbr` were failing when run with an old version of
> >> `gas` which did not recognise the extension. Fix by gating on the
> >> extension being supported by the assembler.
> > I don't see aarch64_asm_cmpbr_ok is defined anywhere.
> > So NAK.
> `aarch64_asm_cmpbr_ok` is already defined in
> `gcc/testsuite/lib/target-supports.exp`. It was added in the original
> patch adding CMPBR support.

Oh I tried a direct grep of aarch64_asm_cmpbr_ok but the function
definition is done using
replacements which is why I didn't realize that. Sorry about that.

##set exts ("cmpbr")
```
foreach { aarch64_ext } $exts {
    eval [string map [list FUNC $aarch64_ext] {
        proc check_effective_target_aarch64_asm_FUNC_ok { } {
```

But as mentioned these are almost all dg-do compile testcases and
don't invoke the assembler.
So only cmpbr-3.c needs to change; also, I agree with Alice here. I
think cmpbr-3.c should just be `dg-do compile`.

Thanks,
Andrew

> >> gcc/testsuite/ChangeLog:
> >>
> >>          * gcc.target/aarch64/cmpbr-1.c
> >>          * gcc.target/aarch64/cmpbr-2.c
> >>          * gcc.target/aarch64/cmpbr-3.c
> >>          * gcc.target/aarch64/cmpbr-4.c
> >>          * gcc.target/aarch64/cmpbr-5.c
> >>          * gcc.target/aarch64/cmpbr.c: Gate on `+cmpbr` assembler support.
> >> ---
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr-1.c | 1 +
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr-2.c | 1 +
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr-3.c | 1 +
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr-4.c | 1 +
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr-5.c | 2 ++
> >>   gcc/testsuite/gcc.target/aarch64/cmpbr.c   | 1 +
> >>   6 files changed, 7 insertions(+)
> >>
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-1.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr-1.c
> >> index 39f1549edd5..516440fd900 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr-1.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-1.c
> >> @@ -1,5 +1,6 @@
> >>   /* { dg-do compile } */
> >>   /* { dg-options "-O2" } */
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >>   /* PR target/121385 */
> >>
> >>   #pragma GCC target "+cmpbr"
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-2.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr-2.c
> >> index 2c2764f131e..3913477e42b 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr-2.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-2.c
> >> @@ -1,5 +1,6 @@
> >>   /* { dg-do compile } */
> >>   /* { dg-options "-O2" } */
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >>   /* PR target/121388 */
> >>
> >>   #pragma GCC target "+cmpbr"
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-3.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr-3.c
> >> index a4f12deef27..85e861f26ee 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr-3.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-3.c
> >> @@ -1,5 +1,6 @@
> >>   /* { dg-do assemble } */
> >>   /* { dg-options "-O2" } */
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >>
> >>   #pragma GCC target "+cmpbr"
> >>
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c
> >> index e266ce1cc77..fe815850686 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-4.c
> >> @@ -1,5 +1,6 @@
> >>   // { dg-do compile }
> >>   // { dg-options "-O2" }
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >>
> >>   #pragma GCC target "+cmpbr"
> >>
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c
> >> index 049e8c107f6..aa3c3c49ef9 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr-5.c
> >> @@ -1,5 +1,7 @@
> >>   /* { dg-do compile } */
> >>   /* { dg-options "-fgimple -O1" } */
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >> +
> >>   #pragma GCC target "+cmpbr"
> >>   typedef unsigned short us;
> >>   __GIMPLE double
> >> diff --git a/gcc/testsuite/gcc.target/aarch64/cmpbr.c 
> >> b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
> >> index 23f462f7db1..c88455684f1 100644
> >> --- a/gcc/testsuite/gcc.target/aarch64/cmpbr.c
> >> +++ b/gcc/testsuite/gcc.target/aarch64/cmpbr.c
> >> @@ -1,6 +1,7 @@
> >>   // Test that the instructions added by FEAT_CMPBR are emitted
> >>   // { dg-do compile }
> >>   // { dg-options "-march=armv9.5-a+cmpbr -O2" }
> >> +/* { dg-require-effective-target aarch64_asm_cmpbr_ok } */
> >>   // { dg-final { check-function-bodies "**" "*/" "" { target *-*-* } 
> >> {\.L[0-9]+} } }
> >>
> >>   #include <stdint.h>
> >> --
> >> 2.43.0
> >>
>

Reply via email to