[libc-commits] [libc] [libc] Disable overflow test in strfromtest (PR #166719)
Marcell Leleszi via libc-commits
libc-commits at lists.llvm.org
Thu Nov 6 09:25:38 PST 2025
https://github.com/mleleszi updated https://github.com/llvm/llvm-project/pull/166719
>From 42dc08b2080a8c6ea6450a7cc244b0544cf3da64 Mon Sep 17 00:00:00 2001
From: Marcell Leleszi <mleleszi at google.com>
Date: Thu, 6 Nov 2025 06:38:41 +0000
Subject: [PATCH 1/2] Comment out CharsWrittenOverflow test in strfromtest
---
libc/test/src/stdlib/StrfromTest.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libc/test/src/stdlib/StrfromTest.h b/libc/test/src/stdlib/StrfromTest.h
index fd2e0f120e90e..3466a605e2256 100644
--- a/libc/test/src/stdlib/StrfromTest.h
+++ b/libc/test/src/stdlib/StrfromTest.h
@@ -514,6 +514,6 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
insufficentBufsize(func); \
} \
TEST_F(LlvmLibc##name##Test, InfAndNanValues) { infNanValues(func); } \
- TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) { \
- charsWrittenOverflow(func); \
- }
+ // TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) { \
+ // charsWrittenOverflow(func); \
+ // }
>From ddbd6337bb0b858458721cc930e73f94aa5af313 Mon Sep 17 00:00:00 2001
From: Marcell Leleszi <mleleszi at google.com>
Date: Thu, 6 Nov 2025 17:24:40 +0000
Subject: [PATCH 2/2] Only disable test for riscv 32
---
libc/test/src/stdlib/CMakeLists.txt | 1 +
libc/test/src/stdlib/StrfromTest.h | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/libc/test/src/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt
index 0eb373c3fa061..42e8faa3fd69f 100644
--- a/libc/test/src/stdlib/CMakeLists.txt
+++ b/libc/test/src/stdlib/CMakeLists.txt
@@ -187,6 +187,7 @@ add_header_library(
DEPENDS
libc.src.__support.CPP.type_traits
libc.src.__support.FPUtil.fp_bits
+ libc.src.__support.macros.properties.architectures
)
add_libc_test(
diff --git a/libc/test/src/stdlib/StrfromTest.h b/libc/test/src/stdlib/StrfromTest.h
index 3466a605e2256..8ddbc73fb38ad 100644
--- a/libc/test/src/stdlib/StrfromTest.h
+++ b/libc/test/src/stdlib/StrfromTest.h
@@ -8,6 +8,7 @@
#include "src/__support/CPP/type_traits.h"
#include "src/__support/FPUtil/FPBits.h"
+#include "src/__support/macros/properties/architectures.h"
#include "test/UnitTest/ErrnoCheckingTest.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
@@ -495,6 +496,16 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
}
};
+// https://github.com/llvm/llvm-project/issues/166795
+#ifndef LIBC_TARGET_ARCH_IS_RISCV32
+#define STRFROM_OVERFLOW_TEST(name, func) \
+ TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) { \
+ charsWrittenOverflow(func); \
+ }
+#else
+#define STRFROM_OVERFLOW_TEST(name, func)
+#endif
+
#define STRFROM_TEST(InputType, name, func) \
using LlvmLibc##name##Test = StrfromTest<InputType>; \
TEST_F(LlvmLibc##name##Test, FloatDecimalFormat) { \
@@ -514,6 +525,4 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest {
insufficentBufsize(func); \
} \
TEST_F(LlvmLibc##name##Test, InfAndNanValues) { infNanValues(func); } \
- // TEST_F(LlvmLibc##name##Test, CharsWrittenOverflow) { \
- // charsWrittenOverflow(func); \
- // }
+ STRFROM_OVERFLOW_TEST(name, func)
More information about the libc-commits
mailing list