[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 10:17:59 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 is it alright if I simply add a test for 80-bit floating points, and add 128 bit tests later when I am more confident? I am not sure how to test the output for 128 bit floating point, and I am unable to find any resources currently, so I might need to do it manually.
Thanks!
https://github.com/llvm/llvm-project/pull/86663
More information about the libc-commits
mailing list