Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc/test/src/stdlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
15 changes: 12 additions & 3 deletions libc/test/src/stdlib/StrfromTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) { \
Expand All @@ -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)
Loading