From: Jakub Jelinek Date: Tue, 4 Aug 2026 19:41:16 +0000 (+0200) Subject: testsuite: Fix up gcc.dg/torture/bitint-100.c test [PR124948] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17d0df5cdb1b2983481612e4e454f659bc5ff738;p=thirdparty%2Fgcc.git testsuite: Fix up gcc.dg/torture/bitint-100.c test [PR124948] 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 PR target/124948 * gcc.dg/torture/bitint-100.c: Require also sync_int_long effective target. Reviewed-by: Andrea Pinski --- diff --git a/gcc/testsuite/gcc.dg/torture/bitint-100.c b/gcc/testsuite/gcc.dg/torture/bitint-100.c index 4c6e781777c..b9a75db67aa 100644 --- a/gcc/testsuite/gcc.dg/torture/bitint-100.c +++ b/gcc/testsuite/gcc.dg/torture/bitint-100.c @@ -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" } { "" } } */