test(libc): make nextafter environment coverage portable

This commit is contained in:
JJenkx committed 2026-10-26 08:24:29 -04:00
1 parent f5f4f7fbf8
commit ef0afbb731
2 files changed
+6 -2

No files matched your search

-1
View File
@@ -1273,7 +1273,6 @@ float APS5_VABI cbrtf_nid_postfix(float x) {
return static_cast<float>(T);
}
float APS5_VABI remainderf_nid_postfix(float x, float y) { return std::remainder(x, y); }
void APS5_VABI _Feraise_nid_postfix(int exceptions);
float APS5_VABI nextafterf_nid_postfix(float x, float y) {
const std::uint32_t ux = std::bit_cast<std::uint32_t>(x);
+6 -1
View File
@@ -705,7 +705,12 @@ static void CheckNextafterEnvironment(T (APS5_VABI *next)(T, T), UInt sign, UInt
const auto expectedFlags = daz ? item.dazFlags : item.normalFlags;
Require(result == (daz ? item.dazResult : item.normalResult));
Require(flags == expectedFlags);
Require(exceptions == static_cast<int>(expectedFlags & FE_ALL_EXCEPT));
const int expectedExceptions = ((expectedFlags & 0x01u) ? FE_INVALID : 0) |
((expectedFlags & 0x04u) ? FE_DIVBYZERO : 0) |
((expectedFlags & 0x08u) ? FE_OVERFLOW : 0) |
((expectedFlags & 0x10u) ? FE_UNDERFLOW : 0) |
((expectedFlags & 0x20u) ? FE_INEXACT : 0);
Require(exceptions == expectedExceptions);
Require(error == (daz ? item.dazError : item.normalError));
}
}