Skip to content

Commit e297238

Browse files
authored
[libc][math] fix nan* death tests failing in asan builds (llvm#77110)
1 parent 63ab56e commit e297238

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

libc/test/src/math/smoke/nan_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ TEST_F(LlvmLibcNanTest, RandomString) {
4242
run_test("123 ", 0x7ff8000000000000);
4343
}
4444

45+
#ifndef LIBC_HAVE_ADDRESS_SANITIZER
4546
TEST_F(LlvmLibcNanTest, InvalidInput) {
4647
EXPECT_DEATH([] { LIBC_NAMESPACE::nan(nullptr); }, WITH_SIGNAL(SIGSEGV));
4748
}
49+
#endif // LIBC_HAVE_ADDRESS_SANITIZER

libc/test/src/math/smoke/nanf_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ TEST_F(LlvmLibcNanfTest, RandomString) {
4141
run_test("123 ", 0x7fc00000);
4242
}
4343

44+
#ifndef LIBC_HAVE_ADDRESS_SANITIZER
4445
TEST_F(LlvmLibcNanfTest, InvalidInput) {
4546
EXPECT_DEATH([] { LIBC_NAMESPACE::nanf(nullptr); }, WITH_SIGNAL(SIGSEGV));
4647
}
48+
#endif // LIBC_HAVE_ADDRESS_SANITIZER

libc/test/src/math/smoke/nanl_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ TEST_F(LlvmLibcNanlTest, RandomString) {
6767
run_test("123 ", expected);
6868
}
6969

70+
#ifndef LIBC_HAVE_ADDRESS_SANITIZER
7071
TEST_F(LlvmLibcNanlTest, InvalidInput) {
7172
EXPECT_DEATH([] { LIBC_NAMESPACE::nanl(nullptr); }, WITH_SIGNAL(SIGSEGV));
7273
}
74+
#endif // LIBC_HAVE_ADDRESS_SANITIZER

0 commit comments

Comments
 (0)