test(libc): read only the five standard exception flags in two Dinkumware tests #20503
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20503"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by kali113 on 2026-11-15T07:33:02Z.
What
On macOS
FE_ALL_EXCEPT(0x3f) includesFE_DENORMAL(0x2), which x86 raises when an operation reads a subnormal operand. Two Dinkumware tests comparefetestexcept(FE_ALL_EXCEPT)with the five standard flags the guest expects, so they fail whenever the host sets the denormal-operand flag even though the result bits,errnoand the MXCSR value are right:GuestDinkumwareDivision.cpp:fetestexcept(FE_ALL_EXCEPT)gives0x2awhere0x28is expected (case 69, result7ff0000000000000, MXCSR0x9faaboth).GuestDinkumwareInternals.cpp: the_Expand_FExpchecks (_Expsubnormal result: result subnormal,errno0, flags0x2).Both now read only
FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT(the internals test already has this asFloatingExceptions). On Linux and Windows the five-flag mask is what the checks meant already; no production code changes.Tested
macOS (Apple M5 Pro, macOS 27.3, x86_64 build under Rosetta), CMake, Ninja, Release,
BUILD_TESTING=ON,CMAKE_OSX_ARCHITECTURES=x86_64, onmain6350d99363with #17425 merged locally (libcurl.prxdoes not link on this machine without it),ctest -R dinkumware:guest_dinkumware_division: failed before (it fails in my full-suite runs onmain+ #17425), passes now.guest_dinkumware_internals: failed before, still fails, but past the_Expchecks: it now stops at_LLog of a zero mantissa, a separate problem (an x87long doubleargument passed to_LLog_nid_postfixfrom the test) that this PR does not touch.guest_dinkumware_*tests pass as before.tools/check_conventions.pypasses. Not run on Linux or Windows.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)GuestDinkumwareInternals.cpp, other lines)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-15T07:33:09Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T07:46:23Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
20dc5a8aa1:tools/check_conventions.pypassed;git diff --checkclean.guest_dinkumware_division_tests,guest_dinkumware_internals_testsbuilt cleanly.guest_dinkumware_division,guest_dinkumware_internals):Looks Good To Me