diff --git a/libc/test/UnitTest/HermeticTestUtils.cpp b/libc/test/UnitTest/HermeticTestUtils.cpp index 73d54b9eeb5ecc..68e31f478d79ab 100644 --- a/libc/test/UnitTest/HermeticTestUtils.cpp +++ b/libc/test/UnitTest/HermeticTestUtils.cpp @@ -104,6 +104,10 @@ void *__dso_handle = nullptr; } // extern "C" +void *operator new(size_t size) { return malloc(size); } + +void *operator new[](size_t size) { return malloc(size); } + void operator delete(void *) { // The libc runtime should not use the global delete operator. Hence, // we just trap here to catch any such accidental usages. diff --git a/libc/test/src/math/smoke/CMakeLists.txt b/libc/test/src/math/smoke/CMakeLists.txt index 65dc80c2a882a5..87b72e2a8eca2e 100644 --- a/libc/test/src/math/smoke/CMakeLists.txt +++ b/libc/test/src/math/smoke/CMakeLists.txt @@ -1214,6 +1214,9 @@ add_fp_unittest( libc.include.signal libc.src.math.nanf libc.src.__support.FPUtil.fp_bits + # FIXME: The nan tests currently have death tests, which aren't supported for + # hermetic tests. + UNIT_TEST_ONLY ) add_fp_unittest( @@ -1227,6 +1230,9 @@ add_fp_unittest( libc.include.signal libc.src.math.nan libc.src.__support.FPUtil.fp_bits + # FIXME: The nan tests currently have death tests, which aren't supported for + # hermetic tests. + UNIT_TEST_ONLY ) add_fp_unittest( @@ -1240,6 +1246,9 @@ add_fp_unittest( libc.include.signal libc.src.math.nanl libc.src.__support.FPUtil.fp_bits + # FIXME: The nan tests currently have death tests, which aren't supported for + # hermetic tests. + UNIT_TEST_ONLY ) # FIXME: These tests are currently spurious for NVPTX.