]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix up gcc.dg/torture/bitint-100.c test [PR124948]
authorJakub Jelinek <jakub@redhat.com>
Tue, 4 Aug 2026 19:41:16 +0000 (21:41 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 4 Aug 2026 19:41:16 +0000 (21:41 +0200)
On Mon, Aug 03, 2026 at 01:56:35PM +0200, Torbjorn SVENSSON wrote:
> On 2026-08-03 13:54, Jakub Jelinek wrote:
> > On Mon, Aug 03, 2026 at 01:50:18PM +0200, Torbjorn SVENSSON wrote:
> > > This change introduces new failures for arm-none-eabi using thumb/arch=armv6s-m/cpu=cortex-m0/float-abi=soft/fpu=auto.
> > >
> > > bitint-100.c:(.text+0x5a): undefined reference to `__atomic_compare_exchange_4'
> > > /build/install-native/arm-none-eabi/bin/ld: (__atomic_compare_exchange_4): Unknown destination type (ARM/Thumb) in /tmp/ccgSaSgH.o
> > > FAIL: gcc.dg/torture/bitint-100.c   -O0  (test for excess errors)
> > >
> > > Same failure exist on both trunk and releases/gcc-16.
> >
> > I thought gcc has been changed to add -latomic_asneeded by default.
> > Or is this because the linker doesn't support it in this configuration?
> To my knowledge, there is no atomic support for armv6s-m, but I can be wrong.

Most of the tests that are dg-do run and use atomics on int/long use
sync_int_long effective target.  Atomics on _BitInt(17), i.e. something
on all currently supported targets larger than short, probably need to be
treated the same.

2026-08-04  Jakub Jelinek  <jakub@redhat.com>

PR target/124948
* gcc.dg/torture/bitint-100.c: Require also sync_int_long effective
target.

Reviewed-by: Andrea Pinski <andrew.pinski@oss.qualcomm.com>
gcc/testsuite/gcc.dg/torture/bitint-100.c

index 4c6e781777c729444dded146c93487d89d6745e2..b9a75db67aaf5a9c58c537b2ea329544fc5cc67b 100644 (file)
@@ -1,5 +1,5 @@
 /* PR target/124948 */
-/* { dg-do run { target bitint } } */
+/* { dg-do run { target { bitint && sync_int_long } } } */
 /* { dg-options "-std=c23 -pedantic-errors" } */
 /* { dg-skip-if "" { ! run_expensive_tests }  { "*" } { "-O0" "-O2" } } */
 /* { dg-skip-if "" { ! run_expensive_tests } { "-flto" } { "" } } */