[flang-commits] [flang] [llvm] [flang][PPC] Implement ieee_set_status and ieee_get_status for AIX (PR #215618)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Mon Aug 17 20:55:57 PDT 2026
================
@@ -142,3 +142,19 @@ TEST(Exceptions, ClearOneLeavesOthersAlone) {
GTEST_SKIP() << "FE_OVERFLOW and FE_INVALID required for this test";
#endif
}
+
+TEST(Exceptions, GetStatusTypeSizeMatchesPlatformLayout) {
+ const std::size_t sz{RTNAME(GetStatusTypeSize)()};
+#if defined(_AIX)
+ EXPECT_EQ(sz, sizeof(std::fenv_t) + sizeof(double))
+ << "expected sizeof(fenv_t)+sizeof(double)="
+ << sizeof(std::fenv_t) + sizeof(double);
----------------
eugeneepshteyn wrote:
(This comment was generated by AI.)
This AIX branch compares `GetStatusTypeSize()` against the same expression the implementation returns, so it cannot catch the drift that would actually hurt: the lowering's hardcoded `kAIXFenvTSize = 20` in `IntrinsicCall.cpp` diverging from the real `sizeof(fenv_t)`. Consider adding, under `_AIX`, `EXPECT_EQ(sizeof(std::fenv_t), 20u);` with a comment cross-referencing that constant, so the AIX bots pin the ABI assumption the lowering hardcodes. Your cross-compilation argument in the earlier thread (the compiler cannot ask the target's runtime for `sizeof(fenv_t)` at compile time) is sound — a hardcoded target-ABI constant is fine, it just wants a target-native test pinning the value, which this test is ideally placed to provide.
https://github.com/llvm/llvm-project/pull/215618
More information about the flang-commits
mailing list