[libc-commits] [libc] [libc] Add inf/nan tests for strfrom*() functions (PR #86663)
Vinayak Dev via libc-commits
libc-commits at lists.llvm.org
Wed Mar 27 11:03:10 PDT 2024
================
@@ -68,11 +69,27 @@ class StrfromTest : public LIBC_NAMESPACE::testing::Test {
written = func(buff, 37, "A simple string with no conversions.", 1.0);
ASSERT_STREQ_LEN(written, buff, "A simple string with no conversions.");
- written =
- func(buff, 37,
- "%A simple string with one conversion, should overwrite.", 1.0);
- ASSERT_STREQ_LEN(written, buff, is_long_double ? "0X8P-3" : "0X1P+0");
-
+ if (is_long_double) {
+ // 64-bit long double values require checking as they will give
+ // a different result
+#if defined(LIBC_TYPES_LONG_DOUBLE_IS_FLOAT64)
----------------
vinayakdsci wrote:
@gchatelet The tests work for 64 bit and 128-bit long doubles, but I am unsure on how to test for 80 bit ones. Do you have any pointers?
https://github.com/llvm/llvm-project/pull/86663
More information about the libc-commits
mailing list