[libcxx-commits] [libcxx] f6fd1c1 - [libc++] Overhaul all tests for assertions and debug mode

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 15 07:56:43 PDT 2022


Author: Louis Dionne
Date: 2022-03-15T10:56:34-04:00
New Revision: f6fd1c1438f0686677e40c026a4c5d9c3780a8ac

URL: https://github.com/llvm/llvm-project/commit/f6fd1c1438f0686677e40c026a4c5d9c3780a8ac
DIFF: https://github.com/llvm/llvm-project/commit/f6fd1c1438f0686677e40c026a4c5d9c3780a8ac.diff

LOG: [libc++] Overhaul all tests for assertions and debug mode

Prior to this patch, there was no distinction between tests that check
basic assertions and tests that check full-fledged iterator debugging
assertions. Both were disabled when support for the debug mode is not
provided in the dylib, which is stronger than it needs to be.

Furthermore, all of the tests using "debug_macros.h" that contain more
than one assertion in them were broken -- any code after the first
assertion would never be executed.

This patch refactors all of our assertion-related tests to:
1. Be enabled whenever they can, i.e. basic assertions tests are run
   even when the debug mode is disabled.
2. Use the superior `check_assertion.h` (previously `debug_mode_helper.h`)
   instead of `debug_macros.h`, which allows multiple assertions in the
   same program.
3. Coalesce some tests into the same file to make them more readable.
4. Use consistent naming for test files -- no more db{1,2,3,...,10} tests.

This is a large but mostly mechanical patch.

Differential Revision: https://reviews.llvm.org/D121462

Added: 
    libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
    libcxx/test/libcxx/debug/check_assertion_test.pass.cpp
    libcxx/test/libcxx/debug/containers.multithread.pass.cpp
    libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
    libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
    libcxx/test/libcxx/debug/containers/string.pass.cpp
    libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
    libcxx/test/libcxx/debug/register_debug_handler.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
    libcxx/test/libcxx/iterators/assert.advance.pass.cpp
    libcxx/test/libcxx/iterators/assert.next.pass.cpp
    libcxx/test/libcxx/iterators/assert.prev.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
    libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
    libcxx/test/support/check_assertion.h

Modified: 
    libcxx/test/libcxx/algorithms/debug_less.pass.cpp
    libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp
    libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp
    libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
    libcxx/test/libcxx/debug/debug_abort.pass.cpp
    libcxx/test/support/container_debug_tests.h
    libcxx/utils/libcxx/test/params.py

Removed: 
    libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
    libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
    libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_cindex_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp
    libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
    libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp
    libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
    libcxx/test/libcxx/debug/containers/db_string.pass.cpp
    libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
    libcxx/test/libcxx/debug/db_string_view.pass.cpp
    libcxx/test/libcxx/debug/debug_helper_test.pass.cpp
    libcxx/test/libcxx/debug/debug_register.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.assert.pass.cpp
    libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/deallocate.assert.pass.cpp
    libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp
    libcxx/test/libcxx/iterators/advance.debug1.pass.cpp
    libcxx/test/libcxx/iterators/next.debug1.pass.cpp
    libcxx/test/libcxx/iterators/prev.debug1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db3.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db4.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db2.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db3.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db4.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db5.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db6.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db7.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db8.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_iter_iter_db1.pass.cpp
    libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
    libcxx/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
    libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
    libcxx/test/support/debug_macros.h
    libcxx/test/support/debug_mode_helper.h


################################################################################
diff  --git a/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp
new file mode 100644
index 0000000000000..2359c4d988517
--- /dev/null
+++ b/libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <algorithm>
+
+// template <class _Compare> struct __debug_less
+
+// Make sure __debug_less asserts when the comparator is not consistent.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <algorithm>
+#include <iterator>
+
+#include "check_assertion.h"
+
+template <int ID>
+struct MyType {
+    int value;
+    explicit MyType(int xvalue = 0) : value(xvalue) {}
+};
+
+template <int ID1, int ID2>
+bool operator<(MyType<ID1> const& LHS, MyType<ID2> const& RHS) {
+    return LHS.value < RHS.value;
+}
+
+template <class ValueType>
+struct BadComparator {
+    bool operator()(ValueType const&, ValueType const&) const {
+        return true;
+    }
+};
+
+int main(int, char**) {
+    typedef MyType<0> MT0;
+    MT0 one(1);
+    MT0 two(2);
+
+    BadComparator<MT0> c;
+    std::__debug_less<BadComparator<MT0>> d(c);
+
+    TEST_LIBCPP_ASSERT_FAILURE(d(one, two), "Comparator does not induce a strict weak ordering");
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
index 5a45ebabaa806..75356e68f871f 100644
--- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
@@ -12,8 +12,7 @@
 
 // __debug_less checks that a comparator actually provides a strict-weak ordering.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <algorithm>
@@ -21,7 +20,7 @@
 #include <cassert>
 
 #include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 template <int ID>
 struct MyType {
@@ -51,14 +50,6 @@ struct GoodComparator : public CompareBase {
     }
 };
 
-template <class ValueType>
-struct BadComparator : public CompareBase {
-    bool operator()(ValueType const&, ValueType const&) const {
-        ++CompareBase::called;
-        return true;
-    }
-};
-
 template <class T1, class T2>
 struct TwoWayHomoComparator : public CompareBase {
     bool operator()(T1 const& lhs, T2 const& rhs) const {
@@ -138,20 +129,6 @@ void test_passing() {
     }
 }
 
-void test_failing() {
-    MT0 one(1);
-    MT0 two(2);
-
-    {
-        typedef BadComparator<MT0> C;
-        typedef __debug_less<C> D;
-        C c;
-        D d(c);
-
-        TEST_LIBCPP_ASSERT_FAILURE(d(one, two), "Comparator does not induce a strict weak ordering");
-    }
-}
-
 template <int>
 struct Tag {
   explicit Tag(int v) : value(v) {}
@@ -271,7 +248,6 @@ constexpr bool test_constexpr() {
 
 int main(int, char**) {
     test_passing();
-    test_failing();
     test_upper_and_lower_bound();
     test_non_const_arg_cmp();
     test_value_iterator();

diff  --git a/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp b/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp
index b680b87ad5f6c..2383f8390bce2 100644
--- a/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/nth_element_stability.pass.cpp
@@ -10,9 +10,7 @@
 
 // Test std::nth_element stability randomization
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <algorithm>

diff  --git a/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp b/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp
index 0fdd41f270326..674cb30ee8e92 100644
--- a/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/partial_sort_stability.pass.cpp
@@ -10,9 +10,7 @@
 
 // Test std::partial_sort stability randomization
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <algorithm>

diff  --git a/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp b/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
index 451eeef2dbf3c..54563a924c24d 100644
--- a/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/sort_stability.pass.cpp
@@ -10,9 +10,7 @@
 
 // Test std::sort stability randomization
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <algorithm>

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
new file mode 100644
index 0000000000000..7150ba0c6b6fd
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.back.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// test that array<T, 0>::back() triggers an assertion
+
+#include <array>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  {
+    typedef std::array<int, 0> C;
+    C c = {};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "cannot call array<T, 0>::back() on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc.back(), "cannot call array<T, 0>::back() on a zero-sized array");
+  }
+  {
+    typedef std::array<const int, 0> C;
+    C c = {{}};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "cannot call array<T, 0>::back() on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc.back(), "cannot call array<T, 0>::back() on a zero-sized array");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
new file mode 100644
index 0000000000000..3395b9e626b2c
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// test that array<T, 0>::back() triggers an assertion
+
+#include <array>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  {
+    typedef std::array<int, 0> C;
+    C c = {};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "cannot call array<T, 0>::front() on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc.front(), "cannot call array<T, 0>::front() on a zero-sized array");
+  }
+  {
+    typedef std::array<const int, 0> C;
+    C c = {{}};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "cannot call array<T, 0>::front() on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc.front(), "cannot call array<T, 0>::front() on a zero-sized array");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
new file mode 100644
index 0000000000000..7168b4209104a
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// test that array<T, 0>::operator[] triggers an assertion
+
+#include <array>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  {
+    typedef std::array<int, 0> C;
+    C c = {};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c[0], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(c[1], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc[0], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc[1], "cannot call array<T, 0>::operator[] on a zero-sized array");
+  }
+  {
+    typedef std::array<const int, 0> C;
+    C c = {{}};
+    C const& cc = c;
+    TEST_LIBCPP_ASSERT_FAILURE(c[0], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(c[1], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc[0], "cannot call array<T, 0>::operator[] on a zero-sized array");
+    TEST_LIBCPP_ASSERT_FAILURE(cc[1], "cannot call array<T, 0>::operator[] on a zero-sized array");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
deleted file mode 100644
index 24610386c9b99..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// test array<T, 0>::front() raises a debug error.
-
-#include <array>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-int main(int, char**)
-{
-  {
-    typedef std::array<int, 0> C;
-    C c = {};
-    C const& cc = c;
-    EXPECT_DEATH( c.back() );
-    EXPECT_DEATH( cc.back() );
-  }
-  {
-    typedef std::array<const int, 0> C;
-    C c = {{}};
-    C const& cc = c;
-    EXPECT_DEATH( c.back() );
-    EXPECT_DEATH( cc.back() );
-  }
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
deleted file mode 100644
index 48715b6300b79..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// test array<T, 0>::front() raises a debug error.
-
-#include <array>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-int main(int, char**)
-{
-  {
-    typedef std::array<int, 0> C;
-    C c = {};
-    C const& cc = c;
-    EXPECT_DEATH(c.front());
-    EXPECT_DEATH(cc.front());
-  }
-  {
-    typedef std::array<const int, 0> C;
-    C c = {{}};
-    C const& cc = c;
-    EXPECT_DEATH(c.front());
-    EXPECT_DEATH(cc.front());
-  }
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp b/libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
deleted file mode 100644
index a8eda0115d4b2..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// test array<T, 0>::operator[] raises a debug error.
-
-#include <array>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-int main(int, char**)
-{
-  {
-    typedef std::array<int, 0> C;
-    C c = {};
-    C const& cc = c;
-    EXPECT_DEATH( c[0] );
-    EXPECT_DEATH( c[1] );
-    EXPECT_DEATH( cc[0] );
-    EXPECT_DEATH( cc[1] );
-  }
-  {
-    typedef std::array<const int, 0> C;
-    C c = {{}};
-    C const& cc = c;
-    EXPECT_DEATH( c[0] );
-    EXPECT_DEATH( c[1] );
-    EXPECT_DEATH( cc[0] );
-    EXPECT_DEATH( cc[1] );
-  }
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
similarity index 82%
rename from libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
index 9b94c80521b58..982f481559317 100644
--- a/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
@@ -10,14 +10,12 @@
 
 // pop_back() more than the number of elements in a deque
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <deque>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     std::deque<int> q;

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
index ade2fd45eb05d..2d464a140adaf 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
@@ -10,17 +10,14 @@
 
 // list(list&& c);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::list<int> l1;
     l1.push_back(1); l1.push_back(2); l1.push_back(3);
     std::list<int>::iterator i = l1.begin();

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
similarity index 81%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
index 46890bfd93718..60fce7a08ab57 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
@@ -10,17 +10,14 @@
 
 // Call erase(const_iterator position) with end()
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int>::const_iterator i = l1.end();

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
similarity index 82%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
index 934d02d502a30..3e615ee630618 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
@@ -10,18 +10,15 @@
 
 // void pop_back();
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <list>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a[] = {1, 2, 3};
     std::list<int> c(a, a+3);
     c.pop_back();

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
index 1963b6ae7fd41..18f9565d75135 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
@@ -10,15 +10,12 @@
 
 // template <class... Args> void emplace(const_iterator p, Args&&... args);
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 struct A {
   explicit A(int i, double d) {
@@ -27,8 +24,7 @@ struct A {
   }
 };
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::list<A> c1;
     std::list<A> c2;
     TEST_LIBCPP_ASSERT_FAILURE(c1.emplace(c2.cbegin(), 2, 3.5),

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
similarity index 87%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
index 46ada6d7a0947..bd10a17bd8e04 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
@@ -10,17 +10,14 @@
 
 // Call erase(const_iterator position) with iterator from another container
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a1[] = {1, 2, 3};
     std::list<int> l1(a1, a1+3);
     std::list<int> l2(a1, a1+3);

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..ea8995dc8fd30
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Call erase(const_iterator first, const_iterator last); with various invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <list>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // First iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::list<int> l1(a1, a1+3);
+        std::list<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l1.cbegin())),
+                                "list::erase(iterator, iterator) called with an iterator not referring to this list");
+    }
+
+    // Second iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::list<int> l1(a1, a1+3);
+        std::list<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), std::next(l2.cbegin())),
+                                "list::erase(iterator, iterator) called with an iterator not referring to this list");
+    }
+
+    // Both iterators from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::list<int> l1(a1, a1+3);
+        std::list<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l2.cbegin())),
+                                "list::erase(iterator, iterator) called with an iterator not referring to this list");
+    }
+
+    // With an invalid range
+    {
+        int a1[] = {1, 2, 3};
+        std::list<int> l1(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
+                                "Attempted to increment a non-incrementable list::const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
similarity index 56%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
index bbc651a1867e4..45e87dfc8a01f 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
@@ -11,24 +11,19 @@
 // template <InputIterator Iter>
 //   iterator insert(const_iterator position, Iter first, Iter last);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
-    {
-        std::list<int> v(100);
-        std::list<int> v2(100);
-        int a[] = {1, 2, 3, 4, 5};
-        TEST_LIBCPP_ASSERT_FAILURE(v.insert(v2.cbegin(), a, a + 5),
-                                   "list::insert(iterator, range) called with an iterator not referring to this list");
-    }
+int main(int, char**) {
+    std::list<int> v(100);
+    std::list<int> v2(100);
+    int a[] = {1, 2, 3, 4, 5};
+    TEST_LIBCPP_ASSERT_FAILURE(v.insert(v2.cbegin(), a, a + 5),
+                                "list::insert(iterator, range) called with an iterator not referring to this list");
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
index 9a3495487b88f..ebfd307a914f8 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
@@ -10,17 +10,14 @@
 
 // iterator insert(const_iterator position, value_type&& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::list<int> v1(3);
     std::list<int> v2(3);
     TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), 4),

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
similarity index 87%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
index f1479f8694993..6a9ea70b255a2 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
@@ -10,17 +10,14 @@
 
 // iterator insert(const_iterator position, size_type n, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::list<int> c1(100);
     std::list<int> c2;
     TEST_LIBCPP_ASSERT_FAILURE(c1.insert(c2.cbegin(), 5, 1),

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
similarity index 87%
rename from libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
index ff61fd9d98bd6..04cc7227ddf93 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
@@ -10,17 +10,14 @@
 
 // iterator insert(const_iterator position, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::list<int> v1(3);
     std::list<int> v2(3);
     int i = 4;

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index 990358718f098..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    int a1[] = {1, 2, 3};
-    std::list<int> l1(a1, a1+3);
-    std::list<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l1.cbegin())),
-                               "list::erase(iterator, iterator) called with an iterator not referring to this list");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index a27441e2f2f6e..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    int a1[] = {1, 2, 3};
-    std::list<int> l1(a1, a1+3);
-    std::list<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), std::next(l2.cbegin())),
-                               "list::erase(iterator, iterator) called with an iterator not referring to this list");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index ff7ee5027c2c0..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    int a1[] = {1, 2, 3};
-    std::list<int> l1(a1, a1+3);
-    std::list<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), std::next(l2.cbegin())),
-                               "list::erase(iterator, iterator) called with an iterator not referring to this list");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index b84f3b7735639..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    int a1[] = {1, 2, 3};
-    std::list<int> l1(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
-                               "Attempted to increment a non-incrementable list::const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
similarity index 58%
rename from libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
index dd75774642d8b..812c7ee9f4dc5 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
@@ -10,23 +10,17 @@
 
 // void splice(const_iterator position, list& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    {
-        std::list<int> v1(3);
-        std::list<int> v2(3);
-        TEST_LIBCPP_ASSERT_FAILURE(v1.splice(v2.begin(), v2),
-                                   "list::splice(iterator, list) called with an iterator not referring to this list");
-    }
+#include "check_assertion.h"
 
+int main(int, char**) {
+  std::list<int> v1(3);
+  std::list<int> v2(3);
+  TEST_LIBCPP_ASSERT_FAILURE(v1.splice(v2.begin(), v2),
+                              "list::splice(iterator, list) called with an iterator not referring to this list");
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
similarity index 57%
rename from libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
index 327a8bbd2419d..9b7d0a95fbfce 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
@@ -10,24 +10,19 @@
 
 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
-    {
-        std::list<int> v1(3);
-        std::list<int> v2(3);
-        TEST_LIBCPP_ASSERT_FAILURE(
-            v1.splice(v1.begin(), v2, v1.begin()),
-            "list::splice(iterator, list, iterator) called with the second iterator not referring to the list argument");
-    }
+int main(int, char**) {
+    std::list<int> v1(3);
+    std::list<int> v2(3);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        v1.splice(v1.begin(), v2, v1.begin()),
+        "list::splice(iterator, list, iterator) called with the second iterator not referring to the list argument");
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
similarity index 57%
rename from libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
index a7c73aea7063a..65a48c5d579dd 100644
--- a/libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
@@ -10,24 +10,19 @@
 
 // void splice(const_iterator position, list& x, iterator first, iterator last);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <list>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
-    {
-      std::list<int> v1(3);
-      std::list<int> v2(3);
-      TEST_LIBCPP_ASSERT_FAILURE(
-          v1.splice(v1.begin(), v2, v2.begin(), v1.end()),
-          "list::splice(iterator, list, iterator, iterator) called with third iterator not referring to the list argument");
-    }
+int main(int, char**) {
+  std::list<int> v1(3);
+  std::list<int> v2(3);
+  TEST_LIBCPP_ASSERT_FAILURE(
+      v1.splice(v1.begin(), v2, v2.begin(), v1.end()),
+      "list::splice(iterator, list, iterator, iterator) called with third iterator not referring to the list argument");
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
new file mode 100644
index 0000000000000..87f8e1da4da84
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call back() on empty container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <vector>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    assert(c.back() == 0);
+    c.clear();
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
+  }
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    assert(c.back() == 0);
+    c.clear();
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
similarity index 53%
rename from libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
index d01e440b374a8..30fff5f31cb2c 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
@@ -10,21 +10,28 @@
 
 // Call back() on empty const container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <vector>
 
-#include "debug_macros.h"
-#include "test_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  const C c;
-  TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    const C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    const C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
similarity index 53%
rename from libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
index 6d0585f0cf009..4c86a093fd1ef 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
@@ -10,21 +10,28 @@
 
 // Call front() on empty const container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <vector>
 
-#include "debug_macros.h"
-#include "test_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  const C c;
-  TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    const C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    const C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
similarity index 61%
rename from libcxx/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
index d41d38d863896..88efa5d20abc0 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
@@ -10,23 +10,31 @@
 
 // Index const vector out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <vector>
 #include <cassert>
 
-#include "debug_macros.h"
-#include "test_macros.h"
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    const C c(1);
+    assert(c[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
+  }
 
-int main(int, char**)
-{
+  {
     typedef int T;
     typedef std::vector<T> C;
     const C c(1);
     assert(c[0] == 0);
     TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
new file mode 100644
index 0000000000000..96944f9f934bb
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call front() on empty container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <vector>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    assert(c.front() == 0);
+    c.clear();
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    assert(c.front() == 0);
+    c.clear();
+    TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
similarity index 52%
rename from libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
index 687db6c3dff62..61f677800e7f6 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
@@ -10,23 +10,31 @@
 
 // Index vector out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <vector>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  assert(c[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    assert(c[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    assert(c[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
similarity index 82%
rename from libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
index cfca9fd9989c6..880b97859e330 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
@@ -10,14 +10,12 @@
 
 // pop_back() more than the number of elements in a vector
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <vector>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     std::vector<int> v;

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
deleted file mode 100644
index 80058412d3918..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call back() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  assert(c.back() == 0);
-  c.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
deleted file mode 100644
index 99c0e73714fd3..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call back() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  assert(c.back() == 0);
-  c.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
deleted file mode 100644
index 4301dc26a55e6..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call back() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  const C c;
-  TEST_LIBCPP_ASSERT_FAILURE(c.back(), "back() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
deleted file mode 100644
index 73fc4a231bd18..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call front() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  const C c;
-  TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_cindex_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cindex_2.pass.cpp
deleted file mode 100644
index 1fa2dca620175..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_cindex_2.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index const vector out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "debug_macros.h"
-#include "test_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  const C c(1);
-  assert(c[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
deleted file mode 100644
index bb2d46e0c97f1..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call front() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  assert(c.front() == 0);
-  c.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
deleted file mode 100644
index 17840aff04728..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Call front() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  assert(c.front() == 0);
-  c.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(c.front(), "front() called on an empty vector");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
deleted file mode 100644
index 4f1658e0b444d..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index vector out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  assert(c[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(c[1], "vector[] index out of bounds");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
deleted file mode 100644
index b7eb3574c9b5f..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Add to iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  C::iterator i = c.begin();
-  i += 1;
-  assert(i == c.end());
-  i = c.begin();
-  TEST_LIBCPP_ASSERT_FAILURE(i + 2, "Attempted to add/subtract an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
deleted file mode 100644
index 9800610cb26af..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  C::iterator i = c.begin();
-  ++i;
-  assert(i == c.end());
-  TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
deleted file mode 100644
index d585fb328c7b8..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  C::iterator i = c.end();
-  TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
deleted file mode 100644
index 8d12f27fe4cca..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Compare iterators from 
diff erent containers with <.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c1;
-  C c2;
-  TEST_LIBCPP_ASSERT_FAILURE(c1.begin() < c2.begin(), "Attempted to compare incomparable iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
deleted file mode 100644
index 8cf0535101954..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Subtract iterators from 
diff erent containers.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c1;
-  C c2;
-  TEST_LIBCPP_ASSERT_FAILURE(c1.begin() - c2.begin(), "Attempted to subtract incompatible iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
deleted file mode 100644
index 1b466cb9c15f7..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Index iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  C::iterator i = c.begin();
-  assert(i[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
deleted file mode 100644
index 44ec064242a79..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Add to iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  C::iterator i = c.begin();
-  i += 1;
-  assert(i == c.end());
-  i = c.begin();
-  TEST_LIBCPP_ASSERT_FAILURE(i + 2, "Attempted to add/subtract an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
deleted file mode 100644
index 4ef8f42219289..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Decrement iterator prior to begin.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  C::iterator i = c.end();
-  --i;
-  assert(i == c.begin());
-  TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
deleted file mode 100644
index 7a55985b1e6e4..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  C::iterator i = c.begin();
-  ++i;
-  assert(i == c.end());
-  TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
deleted file mode 100644
index 9fce0ce162716..0000000000000
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T> C;
-  C c(1);
-  C::iterator i = c.end();
-  TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp
new file mode 100644
index 0000000000000..5b104245f8791
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Add to iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <vector>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    i += 1;
+    assert(i == c.end());
+    i = c.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(i + 2, "Attempted to add/subtract an iterator outside its valid range");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    C::iterator i = c.begin();
+    i += 1;
+    assert(i == c.end());
+    i = c.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(i + 2, "Attempted to add/subtract an iterator outside its valid range");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
similarity index 55%
rename from libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
index ccdbf486bfd47..08042bcae2beb 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
@@ -10,22 +10,30 @@
 
 // Compare iterators from 
diff erent containers with <.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <vector>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c1;
-  C c2;
-  TEST_LIBCPP_ASSERT_FAILURE(c1.begin() < c2.begin(), "Attempted to compare incomparable iterators");
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c1;
+    C c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.begin() < c2.begin(), "Attempted to compare incomparable iterators");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c1;
+    C c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.begin() < c2.begin(), "Attempted to compare incomparable iterators");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
similarity index 50%
rename from libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
index 8a069b11c2c2d..2e50c31fd0063 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
@@ -10,25 +10,35 @@
 
 // Decrement iterator prior to begin.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <vector>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  C::iterator i = c.end();
-  --i;
-  assert(i == c.begin());
-  TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    --i;
+    assert(i == c.begin());
+    TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    C::iterator i = c.end();
+    --i;
+    assert(i == c.begin());
+    TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
similarity index 61%
rename from libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
index 3d5acd39e7011..40c68f9bc5283 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
@@ -6,27 +6,34 @@
 //
 //===----------------------------------------------------------------------===//
 
-// <unordered_set>
+// <vector>
 
 // Dereference non-dereferenceable iterator.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
-#include <unordered_set>
+#include <vector>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    C::iterator i = c.end();
+    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
+  }
+
+  {
     typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+    typedef std::vector<T, min_allocator<T> > C;
     C c(1);
     C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
+    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
similarity index 60%
rename from libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
index aaa366925e206..3826ca5d427f8 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
@@ -6,31 +6,39 @@
 //
 //===----------------------------------------------------------------------===//
 
-// <unordered_set>
+// <vector>
 
 // Increment iterator past end.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
-#include <unordered_set>
+#include <vector>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
+  }
+
+  {
     typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c({42});
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
     C::iterator i = c.begin();
-    assert(i != c.end());
     ++i;
     assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
+    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
similarity index 51%
rename from libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
index dc1a589ab170b..918417fca2a42 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
@@ -10,24 +10,33 @@
 
 // Index iterator out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <vector>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c(1);
-  C::iterator i = c.begin();
-  assert(i[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c(1);
+    C::iterator i = c.begin();
+    assert(i[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c(1);
+    C::iterator i = c.begin();
+    assert(i[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
similarity index 54%
rename from libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
rename to libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
index f654dcaef253b..43578791b07ed 100644
--- a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
+++ b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
@@ -10,22 +10,30 @@
 
 // Subtract iterators from 
diff erent containers.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <vector>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef int T;
-  typedef std::vector<T, min_allocator<T> > C;
-  C c1;
-  C c2;
-  TEST_LIBCPP_ASSERT_FAILURE(c1.begin() - c2.begin(), "Attempted to subtract incompatible iterators");
+  {
+    typedef int T;
+    typedef std::vector<T> C;
+    C c1;
+    C c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.begin() - c2.begin(), "Attempted to subtract incompatible iterators");
+  }
+
+  {
+    typedef int T;
+    typedef std::vector<T, min_allocator<T> > C;
+    C c1;
+    C c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.begin() - c2.begin(), "Attempted to subtract incompatible iterators");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
similarity index 83%
rename from libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
index 5c4bb4cbac22b..faaffea56be26 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
@@ -10,15 +10,13 @@
 
 // size_type bucket(const key_type& __k) const;
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
index cdadd45706bab..fba3e595438b0 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
@@ -14,15 +14,13 @@
 
 // size_type bucket_size(size_type n) const
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
index 1386bf83239b3..9ece4f90ca2df 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
@@ -15,15 +15,13 @@
 // float max_load_factor() const;
 // void max_load_factor(float mlf);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_map<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
deleted file mode 100644
index dfb0acb407a47..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
deleted file mode 100644
index 7f16d65c65157..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp
deleted file mode 100644
index 59dc2f3ef0ed0..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp
deleted file mode 100644
index 3eb7c6c1059d5..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
deleted file mode 100644
index 7cf17924dcc7b..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(42, std::string()));
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
deleted file mode 100644
index 96e6ce9367dbe..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp
deleted file mode 100644
index 8b748591d49bb..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c({{42, std::string()}});
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
index 00328a9182149..fe0e35678a24b 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
@@ -10,14 +10,13 @@
 
 // iterator insert(const_iterator p, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
+#include "check_assertion.h"
 #include "test_macros.h"
-#include "debug_macros.h"
 
 int main(int, char**) {
     typedef std::unordered_map<double, int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
similarity index 92%
rename from libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
index e716e6157ba4e..27ab8095ce68a 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
@@ -6,22 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-
 // <unordered_map>
 
 // template <class P,
 //           class = typename enable_if<is_convertible<P, value_type>::value>::type>
 //     iterator insert(const_iterator p, P&& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
+#include "check_assertion.h"
 #include "test_macros.h"
-#include "debug_macros.h"
 
 int main(int, char**) {
     typedef std::unordered_map<double, int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..5cae9d319a776
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_map<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
+    }
+
+    {
+        typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                                   min_allocator<std::pair<const int, std::string>>> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..bb07d6f83822e
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <cassert>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_map<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.begin();
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
+    }
+
+    {
+        typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                                   min_allocator<std::pair<const int, std::string>>> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.begin();
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..d30e61079aac2
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_map<int, std::string> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+    }
+
+    {
+        typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                                   min_allocator<std::pair<const int, std::string>>> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..dcfe2cfc11764
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <string>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_map<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(42, std::string()));
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
+    }
+
+    {
+        typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
+                                   min_allocator<std::pair<const int, std::string>>> C;
+        C c({{42, std::string()}});
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
index 6735611a81a1d..b1b8192975019 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
@@ -14,14 +14,12 @@
 
 // void swap(unordered_map& x, unordered_map& y);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::pair<int, int> P;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp
new file mode 100644
index 0000000000000..09a27bb8c42e0
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Call erase(const_iterator position) with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With end()
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        std::unordered_map<int, int>::const_iterator i = l1.end();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
+                                "unordered container erase(iterator) called with a non-dereferenceable iterator");
+    }
+
+    // With iterator from another container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        std::unordered_map<int, int> l2(a1, a1+3);
+        std::unordered_map<int, int>::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..d8c6b7190da0a
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Call erase(const_iterator first, const_iterator last); with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // First iterator from a 
diff erent container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        std::unordered_map<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l1.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // Second iterator from a 
diff erent container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        std::unordered_map<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l1.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // Both iterators from a 
diff erent container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        std::unordered_map<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With iterators that don't form a valid range
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_map<int, int> l1(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
+                                "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
deleted file mode 100644
index 2463a57dfc8ff..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator position) with end()
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    std::unordered_map<int, int>::const_iterator i = l1.end();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                               "unordered container erase(iterator) called with a non-dereferenceable iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
deleted file mode 100644
index f671be5b8d509..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    std::unordered_map<int, int> l2(a1, a1+3);
-    std::unordered_map<int, int>::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index 90f50a43585f2..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    std::unordered_map<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l1.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index 00802050040d8..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    std::unordered_map<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l1.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index 5f3ec8301e3cd..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    std::unordered_map<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index 6404cf1d0da41..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_map<int, int> l1(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
-                               "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
index d956ac542fef2..b0b9fb004843f 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
@@ -14,15 +14,13 @@
 
 // size_type bucket(const key_type& __k) const;
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
index 1f8e8ff9a7791..1f95e17473c54 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
@@ -14,15 +14,13 @@
 
 // size_type bucket_size(size_type n) const
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
index 6f95c956d47a1..559ac62927322 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
@@ -15,15 +15,13 @@
 // float max_load_factor() const;
 // void max_load_factor(float mlf);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multimap<int, std::string> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp
deleted file mode 100644
index 42cec3100807b..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp
deleted file mode 100644
index c9be4ccae701d..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.begin();
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp
deleted file mode 100644
index dc9a0b6f0dc8d..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp
deleted file mode 100644
index 3658082fd255a..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp
deleted file mode 100644
index d521a9a47fa90..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string> C;
-    C c;
-    c.insert(std::make_pair(42, std::string()));
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp
deleted file mode 100644
index 4cc131758cd0c..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp
deleted file mode 100644
index fd1c1e11adefe..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c({{1, std::string()}});
-    c.insert(std::make_pair(42, std::string()));
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
similarity index 91%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
index 623ba1c190a7e..1d5d259490727 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
@@ -10,14 +10,12 @@
 
 // iterator insert(const_iterator p, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multimap<double, int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
similarity index 89%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
index 8641cecfd2232..b968d389611ed 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
@@ -6,22 +6,18 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-
 // <unordered_map>
 
 // template <class P,
 //           class = typename enable_if<is_convertible<P, value_type>::value>::type>
 //     iterator insert(const_iterator p, P&& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multimap<double, int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..68b873a5bbcf7
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+#include <unordered_map>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
+    }
+
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                                        min_allocator<std::pair<const int, std::string>>> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..139e733df0035
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <cassert>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.begin();
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
+    }
+
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                            min_allocator<std::pair<const int, std::string>>> C;
+        C c;
+        c.insert(std::make_pair(1, "one"));
+        C::iterator i = c.begin();
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..0f6cc2079d276
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+    }
+
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                                        min_allocator<std::pair<const int, std::string>>> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..2acdefb58b1b4
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+#include <cassert>
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef std::unordered_multimap<int, std::string> C;
+        C c;
+        c.insert(std::make_pair(42, std::string()));
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
+    }
+
+    {
+        typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
+                                        min_allocator<std::pair<const int, std::string>>> C;
+        C c({{1, std::string()}});
+        c.insert(std::make_pair(42, std::string()));
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
similarity index 92%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
index d8bf7fef14363..936ba0279fcd9 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
@@ -14,17 +14,14 @@
 
 // void swap(unordered_multimap& x, unordered_multimap& y);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_map>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     typedef std::pair<int, int> P;
     P a1[] = {P(1, 1), P(3, 3), P(7, 7), P(9, 9), P(10, 10)};
     P a2[] = {P(0, 0), P(2, 2), P(4, 4), P(5, 5), P(6, 6), P(8, 8), P(11, 11)};

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp
new file mode 100644
index 0000000000000..17518d38e4e3d
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Call erase(const_iterator position) with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With end()
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        std::unordered_multimap<int, int>::const_iterator i = l1.end();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
+                                "unordered container erase(iterator) called with a non-dereferenceable iterator");
+    }
+
+    // With iterator from another container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        std::unordered_multimap<int, int> l2(a1, a1+3);
+        std::unordered_multimap<int, int>::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..f07d2db6943e4
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// Call erase(const_iterator first, const_iterator last); with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With first iterator from another container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        std::unordered_multimap<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l1.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With second iterator from another container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        std::unordered_multimap<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l1.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With both iterators from another container
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        std::unordered_multimap<int, int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With an invalid range
+    {
+        typedef std::pair<int, int> P;
+        P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
+        std::unordered_multimap<int, int> l1(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
+                                "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp
deleted file mode 100644
index acfefc51da8f9..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator position) with end()
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    std::unordered_multimap<int, int>::const_iterator i = l1.end();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                               "unordered container erase(iterator) called with a non-dereferenceable iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp
deleted file mode 100644
index 4b62979b12681..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    std::unordered_multimap<int, int> l2(a1, a1+3);
-    std::unordered_multimap<int, int>::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index edcaf969e595f..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    std::unordered_multimap<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l1.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index c33b515e780a6..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    std::unordered_multimap<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l1.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index a50ab9b058a44..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    std::unordered_multimap<int, int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index cc1a83667ab32..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_map>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::pair<int, int> P;
-    P a1[] = {P(1, 1), P(2, 2), P(3, 3)};
-    std::unordered_multimap<int, int> l1(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
-                               "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
similarity index 85%
rename from libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
index ac543d1e8d03f..0350cd39866f3 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
@@ -14,14 +14,12 @@
 
 // size_type bucket(const key_type& __k) const;
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multiset<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
similarity index 85%
rename from libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
index 7910713b76ac5..a6c9c310470d0 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
@@ -14,14 +14,12 @@
 
 // size_type bucket_size(size_type n) const
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multiset<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
index 37c6e0b51a7b9..e1d07c8ca4f57 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
@@ -15,14 +15,12 @@
 // float max_load_factor() const;
 // void max_load_factor(float mlf);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multiset<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp
deleted file mode 100644
index 6f632a0667607..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp
deleted file mode 100644
index 591e898fee4bc..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T> C;
-    C c;
-    c.insert(42);
-    C::iterator i = c.begin();
-    assert(i != c.end());
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp
deleted file mode 100644
index 50a837295bb8a..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp
deleted file mode 100644
index 0d6f6b0287dfd..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c({42});
-    C::iterator i = c.begin();
-    assert(i != c.end());
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp
deleted file mode 100644
index a1a1f206183a5..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp
deleted file mode 100644
index bc9438d3045ec..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T> C;
-    C c;
-    c.insert(42);
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i,
-                               "Attempted to increment a non-incrementable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp
deleted file mode 100644
index f597f6a12b87b..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp
deleted file mode 100644
index dce0d772c3394..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c({42});
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i,
-                               "Attempted to increment a non-incrementable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp
new file mode 100644
index 0000000000000..bdae4da9f1d9b
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With end()
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        std::unordered_multiset<int>::const_iterator i = l1.end();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
+                                "unordered container erase(iterator) called with a non-dereferenceable iterator");
+    }
+
+    // With iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        std::unordered_multiset<int> l2(a1, a1+3);
+        std::unordered_multiset<int>::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..bb9ee05d47160
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With first iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        std::unordered_multiset<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l1.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With second iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        std::unordered_multiset<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l1.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With both iterators from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        std::unordered_multiset<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With an invalid range
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_multiset<int> l1(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
+                                "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
similarity index 91%
rename from libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
index 88108de960372..d70494a753857 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
@@ -10,14 +10,12 @@
 
 // iterator insert(const_iterator p, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_multiset<double> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..0d747d5960285
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T> C;
+        C c(1);
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c(1);
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..aa10eb1b08de6
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T> C;
+        C c;
+        c.insert(42);
+        C::iterator i = c.begin();
+        assert(i != c.end());
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c({42});
+        C::iterator i = c.begin();
+        assert(i != c.end());
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..b74488a36bf4d
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..a2456ffe2ec60
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T> C;
+        C c;
+        c.insert(42);
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i,
+                                "Attempted to increment a non-incrementable unordered container const_local_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_multiset<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c({42});
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i,
+                                "Attempted to increment a non-incrementable unordered container const_local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
index a7f3d84e39bf2..68c8bbcf82b87 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
@@ -14,14 +14,12 @@
 
 // void swap(unordered_multiset& x, unordered_multiset& y);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     int a1[] = {1, 3, 7, 9, 10};

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
deleted file mode 100644
index 7b37704b0fcb5..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator position) with end()
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    std::unordered_multiset<int>::const_iterator i = l1.end();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                               "unordered container erase(iterator) called with a non-dereferenceable iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp
deleted file mode 100644
index bfa8d8d09765e..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    std::unordered_multiset<int> l2(a1, a1+3);
-    std::unordered_multiset<int>::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index c468f6bdfbcae..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    std::unordered_multiset<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l1.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index 626ae924ac5f7..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    std::unordered_multiset<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l1.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index 195d8a6a55adf..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    std::unordered_multiset<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index d4aa964af9c00..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_multiset<int> l1(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
-                               "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
similarity index 85%
rename from libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
index 8abe885466466..adcd5de6737d1 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
@@ -14,14 +14,12 @@
 
 // size_type bucket(const key_type& __k) const;
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_set<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
similarity index 85%
rename from libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
index e83440edb7519..13741525b7b0b 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
@@ -14,14 +14,12 @@
 
 // size_type bucket_size(size_type n) const
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_set<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
index c4514d110ad24..e0c98ed478262 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
@@ -15,14 +15,12 @@
 // float max_load_factor() const;
 // void max_load_factor(float mlf);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_set<int> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp
deleted file mode 100644
index a894b76490f50..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T> C;
-    C c;
-    c.insert(42);
-    C::iterator i = c.begin();
-    assert(i != c.end());
-    ++i;
-    assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp
deleted file mode 100644
index c874de8d80aa2..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T> C;
-    C c(1);
-    C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp
deleted file mode 100644
index 8cb01cdd9abd1..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp
deleted file mode 100644
index 0082d836a24ec..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T> C;
-    C c;
-    c.insert(42);
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i,
-                               "Attempted to increment a non-incrementable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp
deleted file mode 100644
index b5ea94061b5bf..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T> C;
-    C c(1);
-    C::local_iterator i = c.end(0);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp
deleted file mode 100644
index 70a4140914db3..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Increment local_iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-    typedef int T;
-    typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
-    C c({42});
-    C::size_type b = c.bucket(42);
-    C::local_iterator i = c.begin(b);
-    assert(i != c.end(b));
-    ++i;
-    assert(i == c.end(b));
-    TEST_LIBCPP_ASSERT_FAILURE(++i,
-                               "Attempted to increment a non-incrementable unordered container const_local_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp
new file mode 100644
index 0000000000000..7e8d7e51eb2d9
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator position) with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With end()
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        std::unordered_set<int>::const_iterator i = l1.end();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
+                                "unordered container erase(iterator) called with a non-dereferenceable iterator");
+    }
+
+    // With iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        std::unordered_set<int> l2(a1, a1+3);
+        std::unordered_set<int>::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..1d8a5ebb423f0
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Call erase(const_iterator first, const_iterator last); with first iterator from another container
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // With first iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        std::unordered_set<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l1.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With second iterator from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        std::unordered_set<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l1.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With both iterators from another container
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        std::unordered_set<int> l2(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            l1.erase(l2.cbegin(), std::next(l2.cbegin())),
+            "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
+    }
+
+    // With an invalid range
+    {
+        int a1[] = {1, 2, 3};
+        std::unordered_set<int> l1(a1, a1+3);
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
+                                "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
similarity index 90%
rename from libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
index 4c00e28bc6b0b..2fe258098f553 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
@@ -10,14 +10,12 @@
 
 // iterator insert(const_iterator p, const value_type& x);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     typedef std::unordered_set<double> C;

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..c7f1bc60d6b44
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_set<T> C;
+        C c(1);
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c(1);
+        C::iterator i = c.end();
+        TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..9466130405a74
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_set<T> C;
+        C c;
+        c.insert(42);
+        C::iterator i = c.begin();
+        assert(i != c.end());
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c({42});
+        C::iterator i = c.begin();
+        assert(i != c.end());
+        ++i;
+        assert(i == c.end());
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp
new file mode 100644
index 0000000000000..4df9f6c1d0876
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_set<T> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c(1);
+        C::local_iterator i = c.end(0);
+        TEST_LIBCPP_ASSERT_FAILURE(
+            *i, "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp
new file mode 100644
index 0000000000000..aa48b31e0b565
--- /dev/null
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// Increment local_iterator past end.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_set>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        typedef std::unordered_set<T> C;
+        C c;
+        c.insert(42);
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_local_iterator");
+    }
+
+    {
+        typedef int T;
+        typedef std::unordered_set<T, std::hash<T>, std::equal_to<T>, min_allocator<T>> C;
+        C c({42});
+        C::size_type b = c.bucket(42);
+        C::local_iterator i = c.begin(b);
+        assert(i != c.end(b));
+        ++i;
+        assert(i == c.end(b));
+        TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container const_local_iterator");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp
rename to libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
index ec66313275a27..a0ef6a1ae6f41 100644
--- a/libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp
+++ b/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
@@ -14,14 +14,12 @@
 
 // void swap(unordered_set& x, unordered_set& y);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <unordered_set>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
     int a1[] = {1, 3, 7, 9, 10};

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp
deleted file mode 100644
index 0aca919026fe7..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator position) with end()
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    std::unordered_set<int>::const_iterator i = l1.end();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                               "unordered container erase(iterator) called with a non-dereferenceable iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp
deleted file mode 100644
index 694bde8135f11..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    std::unordered_set<int> l2(a1, a1+3);
-    std::unordered_set<int>::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(i), "unordered container erase(iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index 5d7b104c1a102..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    std::unordered_set<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l1.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index 9e06601a6daf2..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    std::unordered_set<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l1.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index 7bd88ebfaef43..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    std::unordered_set<int> l2(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), std::next(l2.cbegin())),
-        "unordered container::erase(iterator, iterator) called with an iterator not referring to this container");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index b9c404377c74c..0000000000000
--- a/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <unordered_set>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_set>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    int a1[] = {1, 2, 3};
-    std::unordered_set<int> l1(a1, a1+3);
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(std::next(l1.cbegin()), l1.cbegin()),
-                               "Attempted to increment a non-incrementable unordered container const_iterator");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/debug/debug_helper_test.pass.cpp b/libcxx/test/libcxx/debug/check_assertion_test.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/debug/debug_helper_test.pass.cpp
rename to libcxx/test/libcxx/debug/check_assertion_test.pass.cpp
index 3e862570fe278..ecce86e4fe437 100644
--- a/libcxx/test/libcxx/debug/debug_helper_test.pass.cpp
+++ b/libcxx/test/libcxx/debug/check_assertion_test.pass.cpp
@@ -6,18 +6,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
 #include <__debug>
-#include "debug_mode_helper.h"
-
 #include <cstdio>
-#include "test_macros.h"
 
+#include "check_assertion.h"
+#include "test_macros.h"
 
 template <class Func>
 inline bool TestDeathTest(const char* stmt, Func&& func, DeathTest::ResultKind ExpectResult, DebugInfoMatcher Matcher = AnyMatcher) {
@@ -58,8 +54,7 @@ void test_unknown() {
   TEST_DEATH_TEST(DeathTest::RK_Unknown, std::exit(13));
 }
 
-int main(int, char**)
-{
+int main(int, char**) {
   test_no_match_found();
   test_did_not_die();
   test_unknown();

diff  --git a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
similarity index 90%
rename from libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp
rename to libcxx/test/libcxx/debug/containers.multithread.pass.cpp
index 70d92e827175c..6cc9effb91984 100644
--- a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
@@ -6,14 +6,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
+// UNSUPPORTED: c++11, c++14
 // UNSUPPORTED: libcpp-has-no-threads
 
+// UNSUPPORTED: libcxx-no-debug-mode, c++03
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
-// test multihtreaded container debugging
+// test multithreaded container debugging
 
 #include <cassert>
 #include <cstddef>
@@ -21,10 +20,6 @@
 #include <list>
 #include <thread>
 #include <vector>
-#include "container_debug_tests.h"
-
-#include "test_macros.h"
-
 
 template <typename Container>
 Container makeContainer(int size) {

diff  --git a/libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp b/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
rename to libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
index e678e16ad4d6c..c5f82856e9e5f 100644
--- a/libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
+// UNSUPPORTED: c++11, c++14
 
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
 // test container debugging
 
@@ -18,9 +17,9 @@
 #include <set>
 #include <utility>
 #include <cassert>
+#include "check_assertion.h"
 #include "container_debug_tests.h"
 #include "test_macros.h"
-#include "debug_mode_helper.h"
 
 using namespace IteratorDebugChecks;
 

diff  --git a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
similarity index 98%
rename from libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
rename to libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
index 7b82a70d3b408..a9692affe256e 100644
--- a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
+// UNSUPPORTED: c++11, c++14
 
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
 // test container debugging
 
@@ -18,9 +17,9 @@
 #include <list>
 #include <vector>
 #include <deque>
+#include "check_assertion.h"
 #include "container_debug_tests.h"
 #include "test_macros.h"
-#include "debug_mode_helper.h"
 
 using namespace IteratorDebugChecks;
 

diff  --git a/libcxx/test/libcxx/debug/containers/db_string.pass.cpp b/libcxx/test/libcxx/debug/containers/string.pass.cpp
similarity index 95%
rename from libcxx/test/libcxx/debug/containers/db_string.pass.cpp
rename to libcxx/test/libcxx/debug/containers/string.pass.cpp
index f74529c6a66dc..7206273c5f5ab 100644
--- a/libcxx/test/libcxx/debug/containers/db_string.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers/string.pass.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
+// UNSUPPORTED: c++11, c++14
 
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
 // test container debugging
 
@@ -18,8 +17,8 @@
 #include <vector>
 
 #include "test_macros.h"
+#include "check_assertion.h"
 #include "container_debug_tests.h"
-#include "debug_mode_helper.h"
 
 using namespace IteratorDebugChecks;
 

diff  --git a/libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp b/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
similarity index 93%
rename from libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
rename to libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
index 979070cd4750a..9831c840443f8 100644
--- a/libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
+++ b/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
@@ -6,11 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
+// UNSUPPORTED: c++11, c++14
 
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
 
 // test container debugging
 
@@ -18,9 +17,9 @@
 #include <unordered_set>
 #include <utility>
 #include <cassert>
+#include "check_assertion.h"
 #include "container_debug_tests.h"
 #include "test_macros.h"
-#include "debug_mode_helper.h"
 
 using namespace IteratorDebugChecks;
 

diff  --git a/libcxx/test/libcxx/debug/db_string_view.pass.cpp b/libcxx/test/libcxx/debug/db_string_view.pass.cpp
deleted file mode 100644
index bd04b062ea641..0000000000000
--- a/libcxx/test/libcxx/debug/db_string_view.pass.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: windows
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// test container debugging
-
-#include <string_view>
-
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-void test_null_argument() {
-  // C++2b prohibits construction of string_view from nullptr_t.
-  const char* nullp = nullptr;
-  const char* null = NULL;
-  (void)nullp;
-  (void)null;
-  EXPECT_DEATH((std::string_view(nullp)));
-  EXPECT_DEATH((std::string_view(null)));
-  EXPECT_DEATH(std::string_view(static_cast<const char*>(0)));
-  {
-    std::string_view v;
-    EXPECT_DEATH(((void)(v == nullp)));
-    EXPECT_DEATH(((void)(nullp == v)));
-  }
-}
-
-int main(int, char**) {
-  test_null_argument();
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/debug/debug_abort.pass.cpp b/libcxx/test/libcxx/debug/debug_abort.pass.cpp
index a74fdb01adf30..f8223436d0256 100644
--- a/libcxx/test/libcxx/debug/debug_abort.pass.cpp
+++ b/libcxx/test/libcxx/debug/debug_abort.pass.cpp
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
 // UNSUPPORTED: libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 // Test that the default debug handler aborts the program.
 

diff  --git a/libcxx/test/libcxx/debug/debug_register.pass.cpp b/libcxx/test/libcxx/debug/register_debug_handler.pass.cpp
similarity index 100%
rename from libcxx/test/libcxx/debug/debug_register.pass.cpp
rename to libcxx/test/libcxx/debug/register_debug_handler.pass.cpp

diff  --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.assert.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
similarity index 85%
rename from libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.assert.pass.cpp
rename to libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
index af6115cc7b135..e73ddfcb98652 100644
--- a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.assert.pass.cpp
+++ b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
@@ -6,31 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
 
 // T* polymorphic_allocator<T>::deallocate(T*, size_t size)
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <experimental/memory_resource>
 #include <type_traits>
 #include <cassert>
 
+#include "check_assertion.h"
 #include "test_memory_resource.h"
 
-#include "test_macros.h"
-#include "debug_macros.h"
-
 namespace ex = std::experimental::pmr;
 
-int main(int, char**)
-{
+int main(int, char**) {
     using Alloc = ex::polymorphic_allocator<int>;
     using Traits = std::allocator_traits<Alloc>;
     NullResource R;

diff  --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/deallocate.assert.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/deallocate.assert.pass.cpp
rename to libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
index 3665729ee46bb..8867f34703499 100644
--- a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/deallocate.assert.pass.cpp
+++ b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
@@ -6,31 +6,25 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-
 // <experimental/memory_resource>
 
 // template <class T> class polymorphic_allocator
 
 // T* polymorphic_allocator<T>::deallocate(T*, size_t size)
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <experimental/memory_resource>
 #include <type_traits>
 #include <cassert>
 
+#include "check_assertion.h"
 #include "test_memory_resource.h"
 
-#include "test_macros.h"
-#include "debug_macros.h"
-
 namespace ex = std::experimental::pmr;
 
-int main(int, char**)
-{
+int main(int, char**) {
     using Alloc = NullAllocator<char>;
 
     AllocController P;

diff  --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
similarity index 53%
rename from libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp
rename to libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
index b29c0ca026cfd..0612c6b604ed6 100644
--- a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp
+++ b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
@@ -6,11 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <filesystem>
 
@@ -21,33 +18,28 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_mode_helper.h"
+#include "check_assertion.h"
 
 int main(int, char**) {
-  using namespace fs;
   // Test incrementing/decrementing a singular iterator
   {
-    path::iterator singular;
-    EXPECT_DEATH( ++singular );
-    EXPECT_DEATH( --singular );
+    fs::path::iterator singular;
+    TEST_LIBCPP_ASSERT_FAILURE(++singular, "attempting to increment a singular iterator");
+    TEST_LIBCPP_ASSERT_FAILURE(--singular, "attempting to decrement a singular iterator");
   }
-  // Test decrementing the begin iterator
+
+  // Test incrementing the end iterator
   {
-    path p("foo/bar");
+    fs::path p("foo/bar");
     auto it = p.begin();
-    ++it;
-    ++it;
-    EXPECT_DEATH( ++it );
+    TEST_LIBCPP_ASSERT_FAILURE(--it, "attempting to decrement the begin iterator");
   }
+
   // Test incrementing the end iterator
   {
-    path p("foo/bar");
+    fs::path p("foo/bar");
     auto it = p.end();
-    EXPECT_DEATH( ++it );
-    --it;
-    --it;
-    EXPECT_DEATH( --it );
+    TEST_LIBCPP_ASSERT_FAILURE(++it, "attempting to increment the end iterator");
   }
 
   return 0;

diff  --git a/libcxx/test/libcxx/iterators/advance.debug1.pass.cpp b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
similarity index 71%
rename from libcxx/test/libcxx/iterators/advance.debug1.pass.cpp
rename to libcxx/test/libcxx/iterators/assert.advance.pass.cpp
index 09a4e6a620d20..f85dae828f9fa 100644
--- a/libcxx/test/libcxx/iterators/advance.debug1.pass.cpp
+++ b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
@@ -6,23 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <list>
 
 // Call advance(non-bidi iterator, -1)
 
 #include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
 
+#include "check_assertion.h"
 #include "test_iterators.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a[] = {1, 2, 3};
 
     bidirectional_iterator<int *> bidi(a+1);
@@ -33,7 +29,7 @@ int main(int, char**)
     forward_iterator<int *> it(a+1);
 	std::advance(it, 1);  // should work fine
 	std::advance(it, 0);  // should work fine
-    EXPECT_DEATH( std::advance(it, -1) ); // can't go backwards on a FwdIter
+    TEST_LIBCPP_ASSERT_FAILURE(std::advance(it, -1), "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/iterators/next.debug1.pass.cpp b/libcxx/test/libcxx/iterators/assert.next.pass.cpp
similarity index 66%
rename from libcxx/test/libcxx/iterators/next.debug1.pass.cpp
rename to libcxx/test/libcxx/iterators/assert.next.pass.cpp
index a7a51f71bb8db..0771539785614 100644
--- a/libcxx/test/libcxx/iterators/next.debug1.pass.cpp
+++ b/libcxx/test/libcxx/iterators/assert.next.pass.cpp
@@ -6,30 +6,24 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <list>
 
 // Call next(non-bidi iterator, -1)
 
 #include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
 
+#include "check_assertion.h"
 #include "test_iterators.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a[] = {1, 2, 3};
-
-
     forward_iterator<int *> it(a+1);
     std::next(it, 1);  // should work fine
     std::next(it, 0);  // should work fine
-    EXPECT_DEATH( std::next(it, -1) ); // can't go backwards on a FwdIter
+    TEST_LIBCPP_ASSERT_FAILURE(std::next(it, -1), "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/iterators/prev.debug1.pass.cpp b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
similarity index 71%
rename from libcxx/test/libcxx/iterators/prev.debug1.pass.cpp
rename to libcxx/test/libcxx/iterators/assert.prev.pass.cpp
index f236cdc442a8e..3b92bce4cbd97 100644
--- a/libcxx/test/libcxx/iterators/prev.debug1.pass.cpp
+++ b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
@@ -6,23 +6,19 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <list>
 
 // Call prev(forward_iterator, -1)
 
 #include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
 
+#include "check_assertion.h"
 #include "test_iterators.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     int a[] = {1, 2, 3};
 
     bidirectional_iterator<int *> bidi(a+1);
@@ -33,7 +29,7 @@ int main(int, char**)
     forward_iterator<int *> it(a+1);
     std::prev(it, -1); // should work fine
     std::prev(it,  0); // should work fine
-    EXPECT_DEATH( std::prev(it, 1) ); // can't go backwards on a FwdIter
+    TEST_LIBCPP_ASSERT_FAILURE(std::prev(it, 1), "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
similarity index 52%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
index bb47d4889e1c7..d1a8cf55f8f7b 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
@@ -10,23 +10,25 @@
 
 // Call back() on empty container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
-#include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S s(1, '\0');
-  assert(s.back() == 0);
-  s.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-
-  return 0;
+    {
+        std::string s;
+        TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
+    }
+
+    {
+        typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+        S s;
+        TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
+    }
+
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
similarity index 51%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
index eb5f22b282fbd..14e3622ec2c6e 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
@@ -10,20 +10,25 @@
 
 // Call back() on empty const container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 
-#include "debug_macros.h"
-#include "test_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  const S s;
-  TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-
-  return 0;
+    {
+        std::string const s;
+        TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
+    }
+
+    {
+        typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+        const S s;
+        TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
+    }
+
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
similarity index 53%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
index cb8ca79a4f2d8..22aacd37bbbe4 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
@@ -10,20 +10,26 @@
 
 // Call front() on empty const container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 
-#include "debug_macros.h"
-#include "test_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  const S s;
-  TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  {
+    typedef std::string S;
+    const S s;
+    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    const S s;
+    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
similarity index 52%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
index 738aac1eb00f5..b238fcd4a02fe 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
@@ -10,22 +10,29 @@
 
 // Index const string out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  const S s;
-  assert(s[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    const S s;
+    assert(s[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  }
+
+  {
+    typedef std::string S;
+    const S s;
+    assert(s[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
similarity index 54%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
index 5b377e533f0d9..c0b4efba75fcb 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
@@ -10,23 +10,27 @@
 
 // Call front() on empty container.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S s(1, '\0');
-  assert(s.front() == 0);
-  s.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  {
+    typedef std::string S;
+    S s;
+    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    S s;
+    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
similarity index 53%
rename from libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
index dae765dbbafa9..33bca86556861 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
@@ -10,22 +10,29 @@
 
 // Index string out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S s;
-  assert(s[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  {
+    typedef std::string S;
+    S s;
+    assert(s[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    S s;
+    assert(s[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp
deleted file mode 100644
index 640a7639d8b49..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// const charT& back() const;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string const s;
-    TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp
deleted file mode 100644
index b6c33b0d35f72..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-//       charT& back();
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string s;
-    TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
deleted file mode 100644
index ab9e19696ac15..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call back() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  S s(1, '\0');
-  assert(s.back() == 0);
-  s.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
deleted file mode 100644
index ce6181b38d33a..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call back() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  const S s;
-  TEST_LIBCPP_ASSERT_FAILURE(s.back(), "string::back(): string is empty");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
deleted file mode 100644
index 8eed44c0a4f96..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call front() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  const S s;
-  TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
deleted file mode 100644
index 3f572af89c21e..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Index const string out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  const S s;
-  assert(s[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
deleted file mode 100644
index 0841d2f726ab4..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call front() on empty container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  S s(1, '\0');
-  assert(s.front() == 0);
-  s.clear();
-  TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
deleted file mode 100644
index c2a6d050b357e..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Index string out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  S s;
-  assert(s[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp
deleted file mode 100644
index f03e7842cbd71..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// const charT& front() const;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string const s;
-    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp
deleted file mode 100644
index 8f6e7d35a3c9a..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-//       charT& front();
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string s;
-    TEST_LIBCPP_ASSERT_FAILURE(s.front(), "string::front(): string is empty");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp
deleted file mode 100644
index cf5de95349d32..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// const_reference operator[](size_type pos) const;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string const s;
-    char c = s[0];
-    assert(c == '\0');
-    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp
deleted file mode 100644
index 691e0e1d82c13..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-//       reference operator[](size_type pos);
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::string s;
-    char c = s[0];
-    assert(c == '\0');
-    TEST_LIBCPP_ASSERT_FAILURE(s[1], "string index out of bounds");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
deleted file mode 100644
index e70ad4260d12a..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Subtract iterators from 
diff erent containers with <.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S s1;
-  S s2;
-  TEST_LIBCPP_ASSERT_FAILURE(s1.begin() - s2.begin(), "Attempted to subtract incompatible iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
deleted file mode 100644
index f35d29afe37c1..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Add to iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  i += 1;
-  assert(i == c.end());
-  i = c.begin();
-  TEST_LIBCPP_ASSERT_FAILURE(i += 2, "Attempted to add/subtract an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
deleted file mode 100644
index 3458f8fdc06b3..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  ++i;
-  assert(i == c.end());
-  TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
deleted file mode 100644
index 79977a75efb5e..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
-  C c(1, '\0');
-  C::iterator i = c.end();
-  TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
deleted file mode 100644
index 1c98997419ba0..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Compare iterators from 
diff erent containers with <.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  S s1;
-  S s2;
-  TEST_LIBCPP_ASSERT_FAILURE(s1.begin() < s2.begin(), "Attempted to compare incomparable iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
deleted file mode 100644
index 71a92dd2a020d..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Subtract iterators from 
diff erent containers with <.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string S;
-  S s1;
-  S s2;
-  TEST_LIBCPP_ASSERT_FAILURE(s1.begin() - s2.begin(), "Attempted to subtract incompatible iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
deleted file mode 100644
index 2e3feceb3b971..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Index iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  assert(i[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
deleted file mode 100644
index 5194ed6013a73..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Add to iterator out of bounds.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  i += 1;
-  assert(i == c.end());
-  i = c.begin();
-  TEST_LIBCPP_ASSERT_FAILURE(i += 2, "Attempted to add/subtract an iterator outside its valid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
deleted file mode 100644
index df0a4fda8d8eb..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Decrement iterator prior to begin.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string C;
-  C c(1, '\0');
-  C::iterator i = c.end();
-  --i;
-  assert(i == c.begin());
-  TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
deleted file mode 100644
index 6567ec16c17f3..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Increment iterator past end.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  ++i;
-  assert(i == c.end());
-  TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
deleted file mode 100644
index a89474c2a3a15..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Dereference non-dereferenceable iterator.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-  typedef std::string C;
-  C c(1, '\0');
-  C::iterator i = c.end();
-  TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp
new file mode 100644
index 0000000000000..72bbb6a983e9c
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Add to iterator out of bounds.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef std::string C;
+    C c(1, '\0');
+    C::iterator i = c.begin();
+    i += 1;
+    assert(i == c.end());
+    i = c.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(i += 2, "Attempted to add/subtract an iterator outside its valid range");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+    C c(1, '\0');
+    C::iterator i = c.begin();
+    i += 1;
+    assert(i == c.end());
+    i = c.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(i += 2, "Attempted to add/subtract an iterator outside its valid range");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
similarity index 55%
rename from libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
index e1e60912d653c..9c75527728237 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
@@ -10,21 +10,28 @@
 
 // Compare iterators from 
diff erent containers with <.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S s1;
-  S s2;
-  TEST_LIBCPP_ASSERT_FAILURE(s1.begin() < s2.begin(), "Attempted to compare incomparable iterators");
+  {
+    typedef std::string S;
+    S s1;
+    S s2;
+    TEST_LIBCPP_ASSERT_FAILURE(s1.begin() < s2.begin(), "Attempted to compare incomparable iterators");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    S s1;
+    S s2;
+    TEST_LIBCPP_ASSERT_FAILURE(s1.begin() < s2.begin(), "Attempted to compare incomparable iterators");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
similarity index 50%
rename from libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
index 7603417b02cbd..188367f090247 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
@@ -10,24 +10,33 @@
 
 // Decrement iterator prior to begin.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <string>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
-  C c(1, '\0');
-  C::iterator i = c.end();
-  --i;
-  assert(i == c.begin());
-  TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  {
+    typedef std::string C;
+    C c(1, '\0');
+    C::iterator i = c.end();
+    --i;
+    assert(i == c.begin());
+    TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+    C c(1, '\0');
+    C::iterator i = c.end();
+    --i;
+    assert(i == c.begin());
+    TEST_LIBCPP_ASSERT_FAILURE(--i, "Attempted to decrement a non-decrementable iterator");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
similarity index 59%
rename from libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
index 6690f8a1a7879..fdedbb60c2f0d 100644
--- a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
@@ -6,29 +6,32 @@
 //
 //===----------------------------------------------------------------------===//
 
-// <unordered_map>
+// <string>
 
 // Dereference non-dereferenceable iterator.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
-#include <unordered_map>
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-    typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
+  {
+    typedef std::string C;
+    C c(1, '\0');
+    C::iterator i = c.end();
+    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+    C c(1, '\0');
     C::iterator i = c.end();
-    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable unordered container iterator");
+    TEST_LIBCPP_ASSERT_FAILURE(*i, "Attempted to dereference a non-dereferenceable iterator");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
similarity index 59%
rename from libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
index b1d0de934278f..bf4eff766da88 100644
--- a/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
@@ -6,32 +6,37 @@
 //
 //===----------------------------------------------------------------------===//
 
-// <unordered_map>
+// <string>
 
 // Increment iterator past end.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-// UNSUPPORTED: c++03
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
-#include <cassert>
 #include <string>
-#include <unordered_map>
+#include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-    typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
-                        min_allocator<std::pair<const int, std::string>>> C;
-    C c;
-    c.insert(std::make_pair(1, "one"));
+  {
+    typedef std::string C;
+    C c(1, '\0');
+    C::iterator i = c.begin();
+    ++i;
+    assert(i == c.end());
+    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+    C c(1, '\0');
     C::iterator i = c.begin();
     ++i;
     assert(i == c.end());
-    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable unordered container iterator");
+    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
similarity index 50%
rename from libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
index 28aa6711dbff3..742b4c94f76fd 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
@@ -10,23 +10,31 @@
 
 // Index iterator out of bounds.
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <string>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 #include "min_allocator.h"
 
 int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
-  C c(1, '\0');
-  C::iterator i = c.begin();
-  assert(i[0] == 0);
-  TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  {
+    typedef std::string C;
+    C c(1, '\0');
+    C::iterator i = c.begin();
+    assert(i[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > C;
+    C c(1, '\0');
+    C::iterator i = c.begin();
+    assert(i[0] == 0);
+    TEST_LIBCPP_ASSERT_FAILURE(i[1], "Attempted to subscript an iterator outside its valid range");
+  }
 
   return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp
new file mode 100644
index 0000000000000..d967071cdb878
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Subtract iterators from 
diff erent containers.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef std::string S;
+    S s1;
+    S s2;
+    TEST_LIBCPP_ASSERT_FAILURE(s1.begin() - s2.begin(), "Attempted to subtract incompatible iterators");
+  }
+
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    S s1;
+    S s2;
+    TEST_LIBCPP_ASSERT_FAILURE(s1.begin() - s2.begin(), "Attempted to subtract incompatible iterators");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
similarity index 58%
rename from libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db1.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
index b1a3f015e4035..e91f8d646b7dc 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db1.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
@@ -10,20 +10,27 @@
 
 // Call erase(const_iterator position) with end()
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+    S l1("123");
+    S::const_iterator i = l1.end();
+    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "string::erase(iterator) called with a non-dereferenceable iterator");
+  }
 
-int main(int, char**)
-{
+  {
     std::string l1("123");
     std::string::const_iterator i = l1.end();
     TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "string::erase(iterator) called with a non-dereferenceable iterator");
+  }
 
-    return 0;
+  return 0;
 }

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
similarity index 77%
rename from libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
index fecd29f9ccd90..8bec8fb815d77 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
@@ -10,17 +10,14 @@
 
 // void pop_back();
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::string s;
     TEST_LIBCPP_ASSERT_FAILURE(s.pop_back(), "string::pop_back(): string is already empty");
 

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp
new file mode 100644
index 0000000000000..739a94cbe30ea
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call erase(const_iterator position) with an iterator from another container
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        std::string l1("123");
+        std::string l2("123");
+        std::string::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "string::erase(iterator) called with an iterator not referring to this string");
+    }
+
+    {
+        typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+        S l1("123");
+        S l2("123");
+        S::const_iterator i = l2.begin();
+        TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "string::erase(iterator) called with an iterator not referring to this string");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp
new file mode 100644
index 0000000000000..2d55d602f946e
--- /dev/null
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp
@@ -0,0 +1,91 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call erase(const_iterator first, const_iterator last); with invalid iterators
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+
+    // With first iterator from another container
+    {
+        {
+            std::string l1("123");
+            std::string l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(
+                l1.erase(l2.cbegin(), l1.cbegin() + 1),
+                "string::erase(iterator,  iterator) called with an iterator not referring to this string");
+        }
+        {
+            typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+            S l1("123");
+            S l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), l1.cbegin() + 1),
+                                        "string::erase(iterator,  iterator) called with an iterator not referring to this string");
+        }
+    }
+
+    // With second iterator from another container
+    {
+        {
+            std::string l1("123");
+            std::string l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), l2.cbegin() + 1), "Attempted to compare incomparable iterators");
+        }
+        {
+            typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+            S l1("123");
+            S l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), l2.cbegin() + 1), "Attempted to compare incomparable iterators");
+        }
+    }
+
+    // With both iterators from another container
+    {
+        {
+            std::string l1("123");
+            std::string l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(
+                l1.erase(l2.cbegin(), l2.cbegin() + 1),
+                "string::erase(iterator,  iterator) called with an iterator not referring to this string");
+        }
+        {
+            typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+            S l1("123");
+            S l2("123");
+            TEST_LIBCPP_ASSERT_FAILURE(
+                l1.erase(l2.cbegin(), l2.cbegin() + 1),
+                "string::erase(iterator,  iterator) called with an iterator not referring to this string");
+        }
+    }
+
+    // With an invalid range
+    {
+        {
+            std::string l1("123");
+            TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin() + 1, l1.cbegin()),
+                                    "string::erase(first, last) called with invalid range");
+        }
+        {
+            typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
+            S l1("123");
+            TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin() + 1, l1.cbegin()),
+                                    "string::erase(first, last) called with invalid range");
+        }
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
similarity index 90%
rename from libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
index ac05b69cf5561..a1463bf353079 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
@@ -10,8 +10,7 @@
 
 // iterator insert(const_iterator p, charT c);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 // TODO: Since string::insert(iter, char) is intantiated in the dylib, this test doesn't
@@ -22,11 +21,9 @@
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     typedef std::string S;
     S s;
     S s2;

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
similarity index 88%
rename from libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_iter_iter_db1.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
index 08ab646041755..3eeb1a363ba34 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_iter_iter_db1.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
@@ -11,17 +11,14 @@
 // template<class InputIterator>
 //   iterator insert(const_iterator p, InputIterator first, InputIterator last);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::string v;
     std::string v2;
     char a[] = "123";

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
similarity index 86%
rename from libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp
rename to libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
index 1e744124eb7c3..55a44ba4b5dbb 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
@@ -10,17 +10,14 @@
 
 // iterator insert(const_iterator p, size_type n, charT c);
 
-// UNSUPPORTED: libcxx-no-debug-mode
-
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
 
 #include <string>
 
-#include "test_macros.h"
-#include "debug_macros.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     std::string s;
     std::string s2;
     TEST_LIBCPP_ASSERT_FAILURE(

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db2.pass.cpp
deleted file mode 100644
index 2a674231a9d5b..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db2.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    std::string l1("123");
-    std::string l2("123");
-    std::string::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                               "string::erase(iterator) called with an iterator not referring to this string");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db3.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db3.pass.cpp
deleted file mode 100644
index d6099bb512bdd..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db3.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator position) with end()
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  S::const_iterator i = l1.end();
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "string::erase(iterator) called with a non-dereferenceable iterator");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db4.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db4.pass.cpp
deleted file mode 100644
index 2c22912933a35..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db4.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator position) with iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  S l2("123");
-  S::const_iterator i = l2.begin();
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i),
-                             "string::erase(iterator) called with an iterator not referring to this string");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644
index c5fe4f8989746..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db1.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    std::string l1("123");
-    std::string l2("123");
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), l1.cbegin() + 1),
-        "string::erase(iterator,  iterator) called with an iterator not referring to this string");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db2.pass.cpp
deleted file mode 100644
index 657c3b602a912..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db2.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    std::string l1("123");
-    std::string l2("123");
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), l2.cbegin() + 1), "Attempted to compare incomparable iterators");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db3.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db3.pass.cpp
deleted file mode 100644
index ae1d03800165d..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db3.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    std::string l1("123");
-    std::string l2("123");
-    TEST_LIBCPP_ASSERT_FAILURE(
-        l1.erase(l2.cbegin(), l2.cbegin() + 1),
-        "string::erase(iterator,  iterator) called with an iterator not referring to this string");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db4.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db4.pass.cpp
deleted file mode 100644
index 0c9f2d16819a5..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db4.pass.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    std::string l1("123");
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin() + 1, l1.cbegin()),
-                               "string::erase(first, last) called with invalid range");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db5.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db5.pass.cpp
deleted file mode 100644
index c4ac4fe4ae1ef..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db5.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with first iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  S l2("123");
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l2.cbegin(), l1.cbegin() + 1),
-                             "string::erase(iterator,  iterator) called with an iterator not referring to this string");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db6.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db6.pass.cpp
deleted file mode 100644
index b2b50998010e1..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db6.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with second iterator from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  S l2("123");
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin(), l2.cbegin() + 1), "Attempted to compare incomparable iterators");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db7.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db7.pass.cpp
deleted file mode 100644
index d51985ca78bcb..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db7.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with both iterators from another container
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  S l2("123");
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin() + 1, l1.cbegin()),
-                             "string::erase(first, last) called with invalid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db8.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db8.pass.cpp
deleted file mode 100644
index 6b5e49fafd4eb..0000000000000
--- a/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db8.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// Call erase(const_iterator first, const_iterator last); with a bad range
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-#include "min_allocator.h"
-
-int main(int, char**) {
-  typedef std::basic_string<char, std::char_traits<char>, min_allocator<char> > S;
-  S l1("123");
-  TEST_LIBCPP_ASSERT_FAILURE(l1.erase(l1.cbegin() + 1, l1.cbegin()),
-                             "string::erase(first, last) called with invalid range");
-
-  return 0;
-}

diff  --git a/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
new file mode 100644
index 0000000000000..c3b8e682abc8a
--- /dev/null
+++ b/libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++11, c++14
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// Construct a string_view from a null pointer
+// constexpr basic_string_view( const CharT* s );
+
+#include <string_view>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  TEST_LIBCPP_ASSERT_FAILURE(std::string_view((char const*)NULL), "null pointer passed to non-null argument of char_traits<...>::length");
+  TEST_LIBCPP_ASSERT_FAILURE(std::string_view((char const*)nullptr), "null pointer passed to non-null argument of char_traits<...>::length");
+  TEST_LIBCPP_ASSERT_FAILURE(std::string_view((char const*)0), "null pointer passed to non-null argument of char_traits<...>::length");
+  {
+    std::string_view v;
+    TEST_LIBCPP_ASSERT_FAILURE(v == (char const*)nullptr, "null pointer passed to non-null argument of char_traits<...>::length");
+    TEST_LIBCPP_ASSERT_FAILURE(v == (char const*)NULL, "null pointer passed to non-null argument of char_traits<...>::length");
+    TEST_LIBCPP_ASSERT_FAILURE((char const*)nullptr == v, "null pointer passed to non-null argument of char_traits<...>::length");
+    TEST_LIBCPP_ASSERT_FAILURE((char const*)NULL == v, "null pointer passed to non-null argument of char_traits<...>::length");
+  }
+
+  return 0;
+}

diff  --git a/libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
similarity index 63%
rename from libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
rename to libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
index 150813de8d9a3..a3f327bc8539e 100644
--- a/libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
+++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
@@ -6,12 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: windows
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <future>
 
@@ -22,26 +20,21 @@
 
 #include <future>
 #include <exception>
-#include <cstdlib>
-#include <cassert>
 
-#include "test_macros.h"
-#include "debug_mode_helper.h"
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     {
         typedef int T;
         std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception(std::exception_ptr()) );
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception(std::exception_ptr()), "promise::set_exception: received nullptr");
     }
+
     {
         typedef int& T;
         std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception(std::exception_ptr()) );
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception(std::exception_ptr()), "promise::set_exception: received nullptr");
     }
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
similarity index 60%
rename from libcxx/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
rename to libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
index 19b67566ee826..911fff3ef50dc 100644
--- a/libcxx/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
+++ b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
@@ -6,12 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: windows
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
 
 // <future>
 
@@ -22,27 +20,21 @@
 
 #include <future>
 #include <exception>
-#include <cstdlib>
-#include <cassert>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
 
+#include "check_assertion.h"
 
-int main(int, char**)
-{
+int main(int, char**) {
     {
         typedef int T;
         std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception_at_thread_exit(std::exception_ptr()) );
-
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception_at_thread_exit(std::exception_ptr()), "promise::set_exception_at_thread_exit: received nullptr");
     }
+
     {
         typedef int& T;
         std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception_at_thread_exit(std::exception_ptr()) );
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception_at_thread_exit(std::exception_ptr()), "promise::set_exception_at_thread_exit: received nullptr");
     }
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
new file mode 100644
index 0000000000000..c389389c10ba7
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <optional>
+
+// constexpr T& optional<T>::operator*() &;
+// constexpr T&& optional<T>::operator*() &&;
+// constexpr const T& optional<T>::operator*() const &;
+// constexpr T&& optional<T>::operator*() const &&;
+
+// UNSUPPORTED: c++11, c++14
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <optional>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    // &
+    {
+        std::optional<int> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(*opt, "optional operator* called on a disengaged value");
+    }
+
+    // &&
+    {
+        std::optional<int> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(*std::move(opt), "optional operator* called on a disengaged value");
+    }
+
+    // const &
+    {
+        const std::optional<int> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(*opt, "optional operator* called on a disengaged value");
+    }
+
+    // const &&
+    {
+        const std::optional<int> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(*std::move(opt), "optional operator* called on a disengaged value");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
new file mode 100644
index 0000000000000..fde804e987eb6
--- /dev/null
+++ b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <optional>
+
+// constexpr T* optional<T>::operator->();
+// constexpr const T* optional<T>::operator->() const;
+
+// UNSUPPORTED: c++11, c++14
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <optional>
+
+#include "check_assertion.h"
+
+struct X {
+    int test() const { return 3; }
+};
+
+int main(int, char**) {
+    {
+        std::optional<X> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(opt->test(), "optional operator-> called on a disengaged value");
+    }
+
+    {
+        const std::optional<X> opt;
+        TEST_LIBCPP_ASSERT_FAILURE(opt->test(), "optional operator-> called on a disengaged value");
+    }
+
+    return 0;
+}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
deleted file mode 100644
index 4fd04dd85fdeb..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr T& optional<T>::operator*() &;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::optional<int> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(*opt, "optional operator* called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
deleted file mode 100644
index 1f660fc658f05..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr const T& optional<T>::operator*() const &;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    const std::optional<int> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(*opt, "optional operator* called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
deleted file mode 100644
index 551e54808ab02..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr T&& optional<T>::operator*() const &&;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    const std::optional<int> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(*std::move(opt), "optional operator* called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
deleted file mode 100644
index 6df3c6c3eb45b..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr T&& optional<T>::operator*() &&;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::optional<int> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(*std::move(opt), "optional operator* called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
deleted file mode 100644
index a4db009e4ffff..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr T* optional<T>::operator->();
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-struct X {
-    int test() noexcept {return 3;}
-};
-
-int main(int, char**) {
-    std::optional<X> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(opt->test(), "optional operator-> called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
deleted file mode 100644
index 0bf2d449b98e8..0000000000000
--- a/libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14
-// <optional>
-
-// constexpr const T* optional<T>::operator->() const;
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <optional>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-struct X {
-    int test() const {return 3;}
-};
-
-int main(int, char**) {
-    const std::optional<X> opt;
-    TEST_LIBCPP_ASSERT_FAILURE(opt->test(), "optional operator-> called on a disengaged value");
-
-    return 0;
-}

diff  --git a/libcxx/test/support/debug_mode_helper.h b/libcxx/test/support/check_assertion.h
similarity index 97%
rename from libcxx/test/support/debug_mode_helper.h
rename to libcxx/test/support/check_assertion.h
index fdda3d77e5055..eb1324e1296c1 100644
--- a/libcxx/test/support/debug_mode_helper.h
+++ b/libcxx/test/support/check_assertion.h
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef TEST_SUPPORT_DEBUG_MODE_HELPER_H
-#define TEST_SUPPORT_DEBUG_MODE_HELPER_H
+#ifndef TEST_SUPPORT_CHECK_ASSERTION_H
+#define TEST_SUPPORT_CHECK_ASSERTION_H
 
 #ifndef _LIBCPP_DEBUG
 #error _LIBCPP_DEBUG must be defined before including this header
@@ -294,4 +294,6 @@ inline bool ExpectDeath(const char* stmt, Func&& func) {
 
 #define EXPECT_DEATH_MATCHES(Matcher, ...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; }, Matcher)))
 
-#endif // TEST_SUPPORT_DEBUG_MODE_HELPER_H
+#define TEST_LIBCPP_ASSERT_FAILURE(expr, message) assert((ExpectDeath(#expr, [&]() { (void)(expr); }, DebugInfoMatcher(message))))
+
+#endif // TEST_SUPPORT_CHECK_ASSERTION_H

diff  --git a/libcxx/test/support/container_debug_tests.h b/libcxx/test/support/container_debug_tests.h
index 203357aa43362..fc0d60f86d0f2 100644
--- a/libcxx/test/support/container_debug_tests.h
+++ b/libcxx/test/support/container_debug_tests.h
@@ -24,9 +24,9 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-#include "debug_mode_helper.h"
+#include "check_assertion.h"
 #include "test_allocator.h"
+#include "test_macros.h"
 
 // These test make use of 'if constexpr'.
 #if TEST_STD_VER <= 14

diff  --git a/libcxx/test/support/debug_macros.h b/libcxx/test/support/debug_macros.h
deleted file mode 100644
index bb1c40b0a97ea..0000000000000
--- a/libcxx/test/support/debug_macros.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TEST_SUPPORT_DEBUG_MACROS_H
-#define TEST_SUPPORT_DEBUG_MACROS_H
-
-#include <__debug>
-#include <cassert>
-#include <string>
-
-static const char* expected_libcpp_assert_message = 0;
-
-static void test_debug_function(std::__libcpp_debug_info const& info) {
-  if (0 == std::strcmp(info.__msg_, expected_libcpp_assert_message))
-    std::exit(0);
-  std::fprintf(stderr, "%s\n", info.what().c_str());
-  std::abort();
-}
-
-#define TEST_LIBCPP_ASSERT_FAILURE(expr, m)                                                                            \
-  do {                                                                                                                 \
-    ::expected_libcpp_assert_message = m;                                                                              \
-    std::__libcpp_set_debug_function(&::test_debug_function);                                                          \
-    (void)(expr);                                                                                                      \
-    assert(false);                                                                                                     \
-  } while (false)
-
-#endif // TEST_SUPPORT_DEBUG_MACROS_H

diff  --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index 81a7d84a111b1..7be5c28b53829 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -125,6 +125,7 @@ def getStdFlag(cfg, std):
             help="The debugging level to enable in the test suite.",
             actions=lambda debugLevel: [] if debugLevel == '' else filter(None, [
               AddFeature('debug_level={}'.format(debugLevel)),
+              AddCompileFlag('-Wno-macro-redefined'),
               AddCompileFlag('-D_LIBCPP_DEBUG={}'.format(debugLevel)),
               AddFeature('LIBCXX-DEBUG-FIXME') if debugLevel == '1' else None
             ])),


        


More information about the libcxx-commits mailing list