[libcxx-commits] [libcxx] [libcxx] [test] Use ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS in more places (PR #144339)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 1 09:21:46 PDT 2025


EricWF wrote:


> It's indeed a rather big hammer. However we already have the vast majority of those allocation tests already disabled through `ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS` (try grepping around the testsuite for this macro); this seems to be just a small number of more cases that gets weren't ignored so far.

All of the other instances of `ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS` are disabling singular asserts _inside tests_. This change proposes disabling entire _test utilities_. I'm concerned that this will disable passing tests (both new and existing) and  obsure what tests are actually running.

I would be OK if we only disabled the failing assertions inside the failing tests. I'm not OK disabling all tests which inspect the allocations.

We could also make the failing tests work, assuming they're not actually trying to test allocation across the dylib. 
One way to get the vector tests passing would be to use a custom `std::basic_string` with a new allocator, preventing the instantiations from playing any role. 


------------
As an aside, we should make an attempt to address the underlying bug here (which appears to be a serious one).

It would make sense to me to disable the external instantiations for `std::string` (or at least some of them) on platforms where `new` cannot be correctly replaced. 

This won't fix all occurrences of `new`  or `delete` in the dylib, but it should fix a large majority of them. 



https://github.com/llvm/llvm-project/pull/144339


More information about the libcxx-commits mailing list