[libcxx-commits] [libcxx] [libcxx][test][z/OS] Fix hermite.pass.cpp for HEX float (PR #101019)

Zibi Sarbinowski via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 29 07:42:01 PDT 2024


https://github.com/zibi2 updated https://github.com/llvm/llvm-project/pull/101019

>From 5df433b4ea5e657079e5d5e7305dc06b0331beeb Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski <zibi at ca.ibm.com>
Date: Mon, 29 Jul 2024 14:01:36 +0000
Subject: [PATCH 1/2] Fix hermite.pass.cpp for HEX float on z/OS

---
 libcxx/test/std/numerics/c.math/hermite.pass.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libcxx/test/std/numerics/c.math/hermite.pass.cpp b/libcxx/test/std/numerics/c.math/hermite.pass.cpp
index 08fbd5c3283c1..fb702369ad036 100644
--- a/libcxx/test/std/numerics/c.math/hermite.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/hermite.pass.cpp
@@ -26,7 +26,12 @@
 
 #include "type_algorithms.h"
 
-inline constexpr unsigned g_max_n = 128;
+inline constexpr unsigned g_max_n =
+#if !(defined(__MVS__) && !defined(__BFP__))
+  128;
+#else
+  39;
+#endif
 
 template <class T>
 std::array<T, 11> sample_points() {
@@ -203,6 +208,7 @@ std::vector<T> get_roots(unsigned n) {
 
 template <class Real>
 void test() {
+#if !(defined(__MVS__) && !defined(__BFP__))
   { // checks if NaNs are reported correctly (i.e. output == input for input == NaN)
     using nl = std::numeric_limits<Real>;
     for (Real NaN : {nl::quiet_NaN(), nl::signaling_NaN()})
@@ -215,6 +221,7 @@ void test() {
       for (unsigned n = 0; n < g_max_n; ++n)
         assert(!std::isnan(std::hermite(n, x)));
   }
+#endif
 
   { // checks std::hermite(n, x) for n=0..5 against analytic polynoms
     const auto h0 = [](Real) -> Real { return 1; };
@@ -289,6 +296,7 @@ void test() {
     }
   }
 
+#if !(defined(__MVS__) && !defined(__BFP__))
   { // check input infinity is handled correctly
     Real inf = std::numeric_limits<Real>::infinity();
     for (unsigned n = 1; n < g_max_n; ++n) {
@@ -316,6 +324,7 @@ void test() {
       }
     }
   }
+#endif
 }
 
 struct TestFloat {

>From 75025ad1b8fd35537bd3fa5e862fefe76b2fd446 Mon Sep 17 00:00:00 2001
From: Zbigniew Sarbinowski <zibi at ca.ibm.com>
Date: Mon, 29 Jul 2024 14:51:25 +0000
Subject: [PATCH 2/2] clang-format change

---
 libcxx/test/std/numerics/c.math/hermite.pass.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libcxx/test/std/numerics/c.math/hermite.pass.cpp b/libcxx/test/std/numerics/c.math/hermite.pass.cpp
index fb702369ad036..2da2b0b5224af 100644
--- a/libcxx/test/std/numerics/c.math/hermite.pass.cpp
+++ b/libcxx/test/std/numerics/c.math/hermite.pass.cpp
@@ -28,9 +28,9 @@
 
 inline constexpr unsigned g_max_n =
 #if !(defined(__MVS__) && !defined(__BFP__))
-  128;
+    128;
 #else
-  39;
+    39;
 #endif
 
 template <class T>



More information about the libcxx-commits mailing list