diff options
author | Nishant Mittal <nishantwrp@google.com> | 2024-01-05 21:21:16 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-05 10:51:16 -0500 |
commit | e2972389111e30a93a21cf8c5f4d2284cbb60268 (patch) | |
tree | 33a35d5d5d53d349634d985872cb1510c26375d2 | |
parent | 63ab56e2a3a05bcb1ca367d9c40eaabd18cb42d5 (diff) |
[libc][math] fix nan* death tests failing in asan builds (#77110)
-rw-r--r-- | libc/test/src/math/smoke/nan_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/math/smoke/nanf_test.cpp | 2 | ||||
-rw-r--r-- | libc/test/src/math/smoke/nanl_test.cpp | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/libc/test/src/math/smoke/nan_test.cpp b/libc/test/src/math/smoke/nan_test.cpp index ae6da143ae41..81e1400f0bb6 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 a602aa9f8ceb..1d337ecf1dcd 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 0a57b567916c..009710b49c83 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 |