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 fd2e0f120e90e..3dacfca9e89f9 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" @@ -484,7 +485,9 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest { ASSERT_STREQ_LEN(written, buff, "-NAN"); } + // https://github.com/llvm/llvm-project/issues/166795 void charsWrittenOverflow(FunctionT func) { +#ifndef LIBC_TARGET_ARCH_IS_RISCV32 char buff[100]; // Trigger an overflow in the return value of strfrom by writing more than // INT_MAX bytes. @@ -492,6 +495,7 @@ class StrfromTest : public LIBC_NAMESPACE::testing::ErrnoCheckingTest { EXPECT_LT(result, 0); ASSERT_ERRNO_FAILURE(); +#endif } };