Skip to content

Commit b932f03

Browse files
[libc] Disable Death Tests While Hermetic (llvm#77388)
The death test infrastructure seems to depend on operator new, which isn't currently supported in our hermetic tests. This patch just disables the death tests in hermetic mode since they only overlap in the nan tests.
1 parent a7262d2 commit b932f03

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libc/test/UnitTest/HermeticTestUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ void *__dso_handle = nullptr;
104104

105105
} // extern "C"
106106

107+
void *operator new(size_t size) { return malloc(size); }
108+
109+
void *operator new[](size_t size) { return malloc(size); }
110+
107111
void operator delete(void *) {
108112
// The libc runtime should not use the global delete operator. Hence,
109113
// we just trap here to catch any such accidental usages.

libc/test/src/math/smoke/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,9 @@ add_fp_unittest(
12141214
libc.include.signal
12151215
libc.src.math.nanf
12161216
libc.src.__support.FPUtil.fp_bits
1217+
# FIXME: The nan tests currently have death tests, which aren't supported for
1218+
# hermetic tests.
1219+
UNIT_TEST_ONLY
12171220
)
12181221

12191222
add_fp_unittest(
@@ -1227,6 +1230,9 @@ add_fp_unittest(
12271230
libc.include.signal
12281231
libc.src.math.nan
12291232
libc.src.__support.FPUtil.fp_bits
1233+
# FIXME: The nan tests currently have death tests, which aren't supported for
1234+
# hermetic tests.
1235+
UNIT_TEST_ONLY
12301236
)
12311237

12321238
add_fp_unittest(
@@ -1240,6 +1246,9 @@ add_fp_unittest(
12401246
libc.include.signal
12411247
libc.src.math.nanl
12421248
libc.src.__support.FPUtil.fp_bits
1249+
# FIXME: The nan tests currently have death tests, which aren't supported for
1250+
# hermetic tests.
1251+
UNIT_TEST_ONLY
12431252
)
12441253

12451254
# FIXME: These tests are currently spurious for NVPTX.

0 commit comments

Comments
 (0)