[flang-commits] [flang] [llvm] [Flang] Introduce common::numeric_limits (PR #228108)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Tue Oct 6 03:27:56 PDT 2026


================
@@ -113,6 +114,34 @@ static void TestVsNative() {
 }
 #endif
 
+template <typename T> static void TestNumericLimitsEquivalence() {
----------------
eugeneepshteyn wrote:

nit: this only exercises the native `__int128` specializations. The `SignedInt128`/`UnsignedInt128` ones, which are what hosts without native `__int128` get, are never instantiated here, although this file already defines `AVOID_NATIVE_UINT128_T`. And where `detail` is selected, the Detail-vs-Common block compares a type with itself. Checking fixed values, e.g. `max() == ~(U{1} << 127)` and `min() == -max() - 1`, would cover both paths everywhere.

https://github.com/llvm/llvm-project/pull/228108


More information about the flang-commits mailing list