From e2972389111e30a93a21cf8c5f4d2284cbb60268 Mon Sep 17 00:00:00 2001 From: Nishant Mittal Date: Fri, 5 Jan 2024 21:21:16 +0530 Subject: [libc][math] fix nan* death tests failing in asan builds (#77110) --- libc/test/src/math/smoke/nan_test.cpp | 2 ++ libc/test/src/math/smoke/nanf_test.cpp | 2 ++ libc/test/src/math/smoke/nanl_test.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/libc/test/src/math/smoke/nan_test.cpp b/libc/test/src/math/smoke/nan_test.cpp index ae6da14..81e1400 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 a602aa9..1d337ec 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 0a57b56..009710b 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 -- cgit v1.1