https://gcc.gnu.org/g:c7f7ed92b9149e9d69df0ce0977f348f0e0551c7
commit r16-8519-gc7f7ed92b9149e9d69df0ce0977f348f0e0551c7 Author: Iain Buclaw <[email protected]> Date: Fri Apr 3 11:35:50 2026 +0200 libphobos: Skip math.hardware unittests on targets without IEEE flags support [PR123202] PR d/123202 libphobos/ChangeLog: * testsuite/lib/libphobos.exp (check_effective_target_phobos_ieee_flags_support): New proc. * testsuite/libphobos.phobos/phobos.exp: Skip math/hardware.d tests if target does not have phobos_iee_flags_support. * testsuite/libphobos.phobos/shared/phobos-shared.exp: Likewise. * testsuite/libphobos.phobos/static/phobos-static.exp: Likewise. Diff: --- libphobos/testsuite/lib/libphobos.exp | 22 ++++++++++++++++++++++ libphobos/testsuite/libphobos.phobos/phobos.exp | 2 ++ .../libphobos.phobos/shared/phobos-shared.exp | 2 ++ .../libphobos.phobos/static/phobos-static.exp | 2 ++ 4 files changed, 28 insertions(+) diff --git a/libphobos/testsuite/lib/libphobos.exp b/libphobos/testsuite/lib/libphobos.exp index 18804befe5d6..b154f22f5abe 100644 --- a/libphobos/testsuite/lib/libphobos.exp +++ b/libphobos/testsuite/lib/libphobos.exp @@ -364,3 +364,25 @@ proc check_effective_target_linux_pre_2639 { } { } return 1 } + +# Return true if target support for manipulating IEEE floating flags +# exists in the std.math.hardware module. +proc check_effective_target_phobos_ieee_flags_support { } { + if { ![check_effective_target_hard_float] } { + return 0 + } + # These targets set `version = IeeeFlagsSupport'. Keep in sync with + # src/std/math/hardware.d. + if { [istarget aarch64*-*-*] + || [istarget arm*-*-*] + || [istarget i?86*-*-*] || [istarget x86_64*-*-*] + || [istarget loongarch64*-*-*] + || [istarget mips*-*-*] + || [istarget powerpc*-*-*] + || [istarget riscv*-*-*] + || [istarget sparc*-*-*] } { + return 1 + } else { + return 0 + } +} diff --git a/libphobos/testsuite/libphobos.phobos/phobos.exp b/libphobos/testsuite/libphobos.phobos/phobos.exp index 3bd80e98181b..17c60156bbd0 100644 --- a/libphobos/testsuite/libphobos.phobos/phobos.exp +++ b/libphobos/testsuite/libphobos.phobos/phobos.exp @@ -36,6 +36,8 @@ if { [is-effective-target linux_pre_2639] } { set libphobos_skip_tests { # Skip concurrency.d test: SEGVs or hangs on macOS 13+ (PR d/111628). { libphobos.phobos/std_concurrency.d { x86_64-apple-darwin2[2-9]* } } + # Skip math/hardware.d if missing necessary support (PR d/123202). + { libphobos.phobos/std_math_hardware.d { ! phobos_ieee_flags_support } } } # Initialize dg. diff --git a/libphobos/testsuite/libphobos.phobos/shared/phobos-shared.exp b/libphobos/testsuite/libphobos.phobos/shared/phobos-shared.exp index c95cb86d1629..39399125111d 100644 --- a/libphobos/testsuite/libphobos.phobos/shared/phobos-shared.exp +++ b/libphobos/testsuite/libphobos.phobos/shared/phobos-shared.exp @@ -44,6 +44,8 @@ set libphobos_skip_tests { { libphobos.phobos/shared/std/net/curl.d { ! libcurl_available } } # Skip concurrency.d test: SEGVs or hangs on macOS 13+ (PR d/111628). { libphobos.phobos/shared/std/concurrency.d { x86_64-apple-darwin2[2-9]* } } + # Skip math/hardware.d if missing necessary support (PR d/123202). + { libphobos.phobos/shared/std/math/hardware.d { ! phobos_ieee_flags_support } } } # Initialize dg. diff --git a/libphobos/testsuite/libphobos.phobos/static/phobos-static.exp b/libphobos/testsuite/libphobos.phobos/static/phobos-static.exp index bf09a38ad70d..e8d745ce25ca 100644 --- a/libphobos/testsuite/libphobos.phobos/static/phobos-static.exp +++ b/libphobos/testsuite/libphobos.phobos/static/phobos-static.exp @@ -44,6 +44,8 @@ set libphobos_skip_tests { { libphobos.phobos/static/std/net/curl.d { ! libcurl_available } } # Skip concurrency.d test: SEGVs or hangs on macOS 13+ (PR d/111628). { libphobos.phobos/static/std/concurrency.d { x86_64-apple-darwin2[2-9]* } } + # Skip math/hardware.d if missing necessary support (PR d/123202). + { libphobos.phobos/static/std/math/hardware.d { ! phobos_ieee_flags_support } } } # Initialize dg.
