Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions libcxx/test/std/containers/sequences/vector/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@ struct throwing_iterator {
};

inline void check_new_delete_called() {
assert(globalMemCounter.new_called == globalMemCounter.delete_called);
assert(globalMemCounter.new_array_called == globalMemCounter.delete_array_called);
assert(globalMemCounter.aligned_new_called == globalMemCounter.aligned_delete_called);
assert(globalMemCounter.aligned_new_array_called == globalMemCounter.aligned_delete_array_called);
ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS(globalMemCounter.new_called == globalMemCounter.delete_called);
ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS(globalMemCounter.new_array_called == globalMemCounter.delete_array_called);
ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS(globalMemCounter.aligned_new_called == globalMemCounter.aligned_delete_called);
ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS(globalMemCounter.aligned_new_array_called == globalMemCounter.aligned_delete_array_called);
}

template <class T, typename Alloc>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
// These tests require locale for non-char paths
// UNSUPPORTED: no-localization

// In MinGW mode, with optimizations enabled with a DLL, the number of counted
// allocations mismatches, as some ctor/dtor calls are generated in the
// calling code, and some are called from the DLL.
// ADDITIONAL_COMPILE_FLAGS: -DALLOW_MISMATCHING_LIBRRARY_INTERNAL_ALLOCATIONS

// <filesystem>

// class path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
// These tests require locale for non-char paths
// UNSUPPORTED: no-localization

// In MinGW mode, with optimizations enabled with a DLL, the number of counted
// allocations mismatches, as some ctor/dtor calls are generated in the
// calling code, and some are called from the DLL.
// ADDITIONAL_COMPILE_FLAGS: -DALLOW_MISMATCHING_LIBRRARY_INTERNAL_ALLOCATIONS

// <filesystem>

// class path
Expand Down
4 changes: 4 additions & 0 deletions libcxx/test/support/count_new.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ struct RequireAllocationGuard {
void requireExactly(std::size_t N) { m_req_alloc = N; m_exactly = true; }

~RequireAllocationGuard() {
#ifdef ALLOW_MISMATCHING_LIBRRARY_INTERNAL_ALLOCATIONS
ASSERT_WITH_LIBRARY_INTERNAL_ALLOCATIONS(globalMemCounter.checkOutstandingNewEq(static_cast<int>(m_outstanding_new_on_init)));
#else
assert(globalMemCounter.checkOutstandingNewEq(static_cast<int>(m_outstanding_new_on_init)));
#endif
std::size_t Expect = m_new_count_on_init + m_req_alloc;
assert(globalMemCounter.checkNewCalledEq(static_cast<int>(Expect)) ||
(!m_exactly && globalMemCounter.checkNewCalledGreaterThan(static_cast<int>(Expect))));
Expand Down
Loading