[libc-commits] [libc] e297238 - [libc][math] fix nan* death tests failing in asan builds (#77110)

via libc-commits libc-commits at lists.llvm.org
Fri Jan 5 07:51:20 PST 2024


Author: Nishant Mittal
Date: 2024-01-05T10:51:16-05:00
New Revision: e2972389111e30a93a21cf8c5f4d2284cbb60268

URL: https://github.com/llvm/llvm-project/commit/e2972389111e30a93a21cf8c5f4d2284cbb60268
DIFF: https://github.com/llvm/llvm-project/commit/e2972389111e30a93a21cf8c5f4d2284cbb60268.diff

LOG: [libc][math] fix nan* death tests failing in asan builds (#77110)

Added: 
    

Modified: 
    libc/test/src/math/smoke/nan_test.cpp
    libc/test/src/math/smoke/nanf_test.cpp
    libc/test/src/math/smoke/nanl_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/math/smoke/nan_test.cpp b/libc/test/src/math/smoke/nan_test.cpp
index ae6da143ae4151..81e1400f0bb6b9 100644
--- a/libc/test/src/math/smoke/nan_test.cpp
+++ b/libc/test/src/math/smoke/nan_test.cpp
@@ -42,6 +42,8 @@ TEST_F(LlvmLibcNanTest, RandomString) {
   run_test("123 ", 0x7ff8000000000000);
 }
 
+#ifndef LIBC_HAVE_ADDRESS_SANITIZER
 TEST_F(LlvmLibcNanTest, InvalidInput) {
   EXPECT_DEATH([] { LIBC_NAMESPACE::nan(nullptr); }, WITH_SIGNAL(SIGSEGV));
 }
+#endif // LIBC_HAVE_ADDRESS_SANITIZER

diff  --git a/libc/test/src/math/smoke/nanf_test.cpp b/libc/test/src/math/smoke/nanf_test.cpp
index a602aa9f8cebed..1d337ecf1dcd08 100644
--- a/libc/test/src/math/smoke/nanf_test.cpp
+++ b/libc/test/src/math/smoke/nanf_test.cpp
@@ -41,6 +41,8 @@ TEST_F(LlvmLibcNanfTest, RandomString) {
   run_test("123 ", 0x7fc00000);
 }
 
+#ifndef LIBC_HAVE_ADDRESS_SANITIZER
 TEST_F(LlvmLibcNanfTest, InvalidInput) {
   EXPECT_DEATH([] { LIBC_NAMESPACE::nanf(nullptr); }, WITH_SIGNAL(SIGSEGV));
 }
+#endif // LIBC_HAVE_ADDRESS_SANITIZER

diff  --git a/libc/test/src/math/smoke/nanl_test.cpp b/libc/test/src/math/smoke/nanl_test.cpp
index 0a57b567916c9a..009710b49c832e 100644
--- a/libc/test/src/math/smoke/nanl_test.cpp
+++ b/libc/test/src/math/smoke/nanl_test.cpp
@@ -67,6 +67,8 @@ TEST_F(LlvmLibcNanlTest, RandomString) {
   run_test("123 ", expected);
 }
 
+#ifndef LIBC_HAVE_ADDRESS_SANITIZER
 TEST_F(LlvmLibcNanlTest, InvalidInput) {
   EXPECT_DEATH([] { LIBC_NAMESPACE::nanl(nullptr); }, WITH_SIGNAL(SIGSEGV));
 }
+#endif // LIBC_HAVE_ADDRESS_SANITIZER


        


More information about the libc-commits mailing list