[libc++] Overhaul all tests for assertions and debug mode
authorLouis Dionne <ldionne.2@gmail.com>
Mon, 7 Mar 2022 21:58:16 +0000 (16:58 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 15 Mar 2022 14:56:34 +0000 (10:56 -0400)
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

321 files changed:
libcxx/test/libcxx/algorithms/debug_less.inconsistent.pass.cpp [new file with mode: 0644]
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/containers/sequences/array/array.zero/assert.back.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/array/array.zero/assert.front.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/array/array.zero/assert.subscript.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/array/array.zero/db_back.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/array/array.zero/db_front.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/array/array.zero/db_indexing.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.back.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/db_back.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_back_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cback.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cfront.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cindex.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_cindex_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_front.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_front_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_index.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_12.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_14.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_15.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_5.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_6.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_const_lvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_local_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.local_iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.map/unord.map.modifiers/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_const_lvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.local_iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multimap/unord.multimap.modifiers/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_insert_hint_const_lvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_local_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.local_iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_insert_hint_const_lvalue.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.local_iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp [deleted file]
libcxx/test/libcxx/debug/check_assertion_test.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/containers.multithread.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp [deleted file]
libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp [deleted file]
libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp [deleted file]
libcxx/test/libcxx/debug/containers/db_string.pass.cpp [deleted file]
libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp [deleted file]
libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/containers/string.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/debug/db_string_view.pass.cpp [deleted file]
libcxx/test/libcxx/debug/debug_abort.pass.cpp
libcxx/test/libcxx/debug/debug_helper_test.pass.cpp [deleted file]
libcxx/test/libcxx/debug/debug_register.pass.cpp [deleted file]
libcxx/test/libcxx/debug/register_debug_handler.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/deallocate.assert.pass.cpp [deleted file]
libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/deallocate.assert.pass.cpp [deleted file]
libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/iterator_db.pass.cpp [deleted file]
libcxx/test/libcxx/iterators/advance.debug1.pass.cpp [deleted file]
libcxx/test/libcxx/iterators/assert.advance.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/iterators/assert.next.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/iterators/assert.prev.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/iterators/next.debug1.pass.cpp [deleted file]
libcxx/test/libcxx/iterators/prev.debug1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.access/back.const.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/back.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_back.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cback.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cfront.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cindex.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_front.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_index.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/front.const.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/front.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/index.const.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.access/index.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_10.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_12.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_14.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_15.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_3.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_4.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_5.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_6.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_7.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_8.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.add.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.subtract.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.erase.iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db2.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db3.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db4.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db5.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db6.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db7.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_iter_iter_db8.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_char_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_iter_iter_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/basic.string/string.modifiers/insert_iter_size_char_db1.pass.cpp [deleted file]
libcxx/test/libcxx/strings/string.view/assert.ctor.pointer.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp [deleted file]
libcxx/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.dereference.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/assert.op_arrow.pass.cpp [new file with mode: 0644]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_const_rvalue.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/dereference_rvalue.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow.pass.cpp [deleted file]
libcxx/test/libcxx/utilities/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp [deleted file]
libcxx/test/support/check_assertion.h [new file with mode: 0644]
libcxx/test/support/container_debug_tests.h
libcxx/test/support/debug_macros.h [deleted file]
libcxx/test/support/debug_mode_helper.h [deleted file]
libcxx/utils/libcxx/test/params.py

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 (file)
index 0000000..2359c4d
--- /dev/null
@@ -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;
+}
index 5a45ebabaa806e6dd5f01734d81f94f6562ff4a2..75356e68f871fb904c4a932de971e45e4a28312f 100644 (file)
@@ -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();
index b680b87ad5f6c800e7a22fc79fccbfd1f323c9fa..2383f8390bce2525665e6d319ab8f29fa1d450bb 100644 (file)
@@ -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>
index 0fdd41f2703261bed626e756da6d5cb194bfb54d..674cb30ee8e92e930cd05cea64345727de9474c5 100644 (file)
@@ -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>
index 451eeef2dbf3cd480de4c50dd978d918e36197b0..54563a924c24d34bfa3ca4797b31f99271ecac89 100644 (file)
@@ -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 (file)
index 0000000..7150ba0
--- /dev/null
@@ -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 (file)
index 0000000..3395b9e
--- /dev/null
@@ -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 (file)
index 0000000..7168b42
--- /dev/null
@@ -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 (file)
index 2461038..0000000
+++ /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 (file)
index 48715b6..0000000
+++ /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 (file)
index a8eda01..0000000
+++ /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/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/assert.pop_back.empty.pass.cpp
new file mode 100644 (file)
index 0000000..982f481
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <deque>
+
+// pop_back() more than the number of elements in a deque
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <deque>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    std::deque<int> q;
+    q.push_back(0);
+    q.pop_back();
+    TEST_LIBCPP_ASSERT_FAILURE(q.pop_back(), "deque::pop_back called on an empty deque");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/pop_back_empty.pass.cpp
deleted file mode 100644 (file)
index 9b94c80..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <deque>
-
-// pop_back() more than the number of elements in a deque
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <deque>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    std::deque<int> q;
-    q.push_back(0);
-    q.pop_back();
-    TEST_LIBCPP_ASSERT_FAILURE(q.pop_back(), "deque::pop_back called on an empty deque");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
deleted file mode 100644 (file)
index ade2fd4..0000000
+++ /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>
-
-// list(list&& c);
-
-// 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**)
-{
-    std::list<int> l1;
-    l1.push_back(1); l1.push_back(2); l1.push_back(3);
-    std::list<int>::iterator i = l1.begin();
-    std::list<int> l2 = l1;
-    TEST_LIBCPP_ASSERT_FAILURE(l2.erase(i), "list::erase(iterator) called with an iterator not referring to this list");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.cons/debug.copy.pass.cpp
new file mode 100644 (file)
index 0000000..2d464a1
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// list(list&& c);
+
+// 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**) {
+    std::list<int> l1;
+    l1.push_back(1); l1.push_back(2); l1.push_back(3);
+    std::list<int>::iterator i = l1.begin();
+    std::list<int> l2 = l1;
+    TEST_LIBCPP_ASSERT_FAILURE(l2.erase(i), "list::erase(iterator) called with an iterator not referring to this list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.erase_iter.end.pass.cpp
new file mode 100644 (file)
index 0000000..60fce7a
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 position) with end()
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <list>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    int a1[] = {1, 2, 3};
+    std::list<int> l1(a1, a1+3);
+    std::list<int>::const_iterator i = l1.end();
+    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(iterator) called with a non-dereferenceable iterator");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/assert.pop_back.empty.pass.cpp
new file mode 100644 (file)
index 0000000..3e615ee
--- /dev/null
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// void pop_back();
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <list>
+#include <cassert>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    int a[] = {1, 2, 3};
+    std::list<int> c(a, a+3);
+    c.pop_back();
+    assert(c == std::list<int>(a, a+2));
+    c.pop_back();
+    assert(c == std::list<int>(a, a+1));
+    c.pop_back();
+    assert(c.empty());
+    TEST_LIBCPP_ASSERT_FAILURE(c.pop_back(), "list::pop_back() called on an empty list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.emplace.pass.cpp
new file mode 100644 (file)
index 0000000..18f9565
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// template <class... Args> void emplace(const_iterator p, Args&&... args);
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <list>
+
+#include "check_assertion.h"
+
+struct A {
+  explicit A(int i, double d) {
+    (void)i;
+    (void)d;
+  }
+};
+
+int main(int, char**) {
+    std::list<A> c1;
+    std::list<A> c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.emplace(c2.cbegin(), 2, 3.5),
+                               "list::emplace(iterator, args...) called with an iterator not referring to this list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.erase.iter.pass.cpp
new file mode 100644 (file)
index 0000000..bd10a17
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 position) with iterator from another container
+
+// 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**) {
+    int a1[] = {1, 2, 3};
+    std::list<int> l1(a1, a1+3);
+    std::list<int> l2(a1, a1+3);
+    std::list<int>::const_iterator i = l2.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(iterator) called with an iterator not referring to this list");
+
+    return 0;
+}
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 (file)
index 0000000..ea8995d
--- /dev/null
@@ -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/debug.insert.iter_iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_iter_iter.pass.cpp
new file mode 100644 (file)
index 0000000..45e87df
--- /dev/null
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <InputIterator Iter>
+//   iterator insert(const_iterator position, Iter first, Iter last);
+
+// 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**) {
+    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;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_rvalue.pass.cpp
new file mode 100644 (file)
index 0000000..ebfd307
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator position, value_type&& x);
+
+// 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**) {
+    std::list<int> v1(3);
+    std::list<int> v2(3);
+    TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), 4),
+                               "list::insert(iterator, x) called with an iterator not referring to this list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_size_value.pass.cpp
new file mode 100644 (file)
index 0000000..6a9ea70
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator position, size_type n, const value_type& x);
+
+// 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**) {
+    std::list<int> c1(100);
+    std::list<int> c2;
+    TEST_LIBCPP_ASSERT_FAILURE(c1.insert(c2.cbegin(), 5, 1),
+                               "list::insert(iterator, n, x) called with an iterator not referring to this list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/debug.insert.iter_value.pass.cpp
new file mode 100644 (file)
index 0000000..04cc722
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator position, const value_type& x);
+
+// 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**) {
+    std::list<int> v1(3);
+    std::list<int> v2(3);
+    int i = 4;
+    TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), i),
+                               "list::insert(iterator, x) called with an iterator not referring to this list");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
deleted file mode 100644 (file)
index 1963b6a..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// template <class... Args> void emplace(const_iterator p, Args&&... args);
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-struct A {
-  explicit A(int i, double d) {
-    (void)i;
-    (void)d;
-  }
-};
-
-int main(int, char**)
-{
-    std::list<A> c1;
-    std::list<A> c2;
-    TEST_LIBCPP_ASSERT_FAILURE(c1.emplace(c2.cbegin(), 2, 3.5),
-                               "list::emplace(iterator, args...) called with an iterator not referring to this list");
-
-    return 0;
-}
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/erase_iter_db1.pass.cpp
deleted file mode 100644 (file)
index 46890bf..0000000
+++ /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 position) with end()
-
-// 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>::const_iterator i = l1.end();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(iterator) called with a non-dereferenceable iterator");
-
-    return 0;
-}
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/erase_iter_db2.pass.cpp
deleted file mode 100644 (file)
index 46ada6d..0000000
+++ /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 position) with 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);
-    std::list<int>::const_iterator i = l2.begin();
-    TEST_LIBCPP_ASSERT_FAILURE(l1.erase(i), "list::erase(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_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
deleted file mode 100644 (file)
index 9903587..0000000
+++ /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 (file)
index a27441e..0000000
+++ /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 (file)
index ff7ee50..0000000
+++ /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 (file)
index b84f3b7..0000000
+++ /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.modifiers/insert_iter_iter_iter_db1.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
deleted file mode 100644 (file)
index bbc651a..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// template <InputIterator Iter>
-//   iterator insert(const_iterator position, Iter first, Iter last);
-
-// 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**)
-{
-    {
-        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;
-}
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/insert_iter_rvalue_db1.pass.cpp
deleted file mode 100644 (file)
index 9a34954..0000000
+++ /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>
-
-// iterator insert(const_iterator position, value_type&& x);
-
-// 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**)
-{
-    std::list<int> v1(3);
-    std::list<int> v2(3);
-    TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), 4),
-                               "list::insert(iterator, x) called with an iterator not referring to this list");
-
-    return 0;
-}
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/insert_iter_size_value_db1.pass.cpp
deleted file mode 100644 (file)
index f1479f8..0000000
+++ /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>
-
-// iterator insert(const_iterator position, size_type n, const value_type& x);
-
-// 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**)
-{
-    std::list<int> c1(100);
-    std::list<int> c2;
-    TEST_LIBCPP_ASSERT_FAILURE(c1.insert(c2.cbegin(), 5, 1),
-                               "list::insert(iterator, n, x) called with an iterator not referring to this list");
-
-    return 0;
-}
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/insert_iter_value_db1.pass.cpp
deleted file mode 100644 (file)
index ff61fd9..0000000
+++ /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>
-
-// iterator insert(const_iterator position, const value_type& x);
-
-// 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**)
-{
-    std::list<int> v1(3);
-    std::list<int> v2(3);
-    int i = 4;
-    TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), i),
-                               "list::insert(iterator, x) called with an iterator not referring to this list");
-
-    return 0;
-}
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/pop_back_db1.pass.cpp
deleted file mode 100644 (file)
index 934d02d..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// void pop_back();
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <list>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    int a[] = {1, 2, 3};
-    std::list<int> c(a, a+3);
-    c.pop_back();
-    assert(c == std::list<int>(a, a+2));
-    c.pop_back();
-    assert(c == std::list<int>(a, a+1));
-    c.pop_back();
-    assert(c.empty());
-    TEST_LIBCPP_ASSERT_FAILURE(c.pop_back(), "list::pop_back() called on an empty list");
-
-    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/db_splice_pos_list.pass.cpp
deleted file mode 100644 (file)
index dd75774..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// void splice(const_iterator position, list& x);
-
-// 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**)
-{
-    {
-        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/db_splice_pos_list_iter.pass.cpp
deleted file mode 100644 (file)
index 327a8bb..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// void splice(const_iterator position, list<T,Allocator>& x, iterator i);
-
-// 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**)
-{
-    {
-        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/db_splice_pos_list_iter_iter.pass.cpp
deleted file mode 100644 (file)
index a7c73ae..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <list>
-
-// void splice(const_iterator position, list& x, iterator first, iterator last);
-
-// 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**)
-{
-    {
-      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/list/list.ops/debug.splice.pos_list.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list.pass.cpp
new file mode 100644 (file)
index 0000000..812c7ee
--- /dev/null
@@ -0,0 +1,26 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// void splice(const_iterator position, list& x);
+
+// 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**) {
+  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/debug.splice.pos_list_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter.pass.cpp
new file mode 100644 (file)
index 0000000..9b7d0a9
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// void splice(const_iterator position, list<T,Allocator>& x, iterator i);
+
+// 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**) {
+    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/debug.splice.pos_list_iter_iter.pass.cpp b/libcxx/test/libcxx/containers/sequences/list/list.ops/debug.splice.pos_list_iter_iter.pass.cpp
new file mode 100644 (file)
index 0000000..65a48c5
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// void splice(const_iterator position, list& x, iterator first, iterator last);
+
+// 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**) {
+  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 (file)
index 0000000..87f8e1d
--- /dev/null
@@ -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/assert.cback.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cback.empty.pass.cpp
new file mode 100644 (file)
index 0000000..30fff5f
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call back() on empty const container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <vector>
+
+#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> 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/assert.cfront.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cfront.empty.pass.cpp
new file mode 100644 (file)
index 0000000..4c86a09
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Call front() on empty const container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <vector>
+
+#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> 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/assert.cindex.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.cindex.oob.pass.cpp
new file mode 100644 (file)
index 0000000..88efa5d
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: 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;
+    const 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;
+    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/assert.front.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.front.empty.pass.cpp
new file mode 100644 (file)
index 0000000..96944f9
--- /dev/null
@@ -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/assert.index.oob.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.index.oob.pass.cpp
new file mode 100644 (file)
index 0000000..61f6778
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: 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[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/assert.pop_back.empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/assert.pop_back.empty.pass.cpp
new file mode 100644 (file)
index 0000000..880b978
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// pop_back() more than the number of elements in a vector
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <vector>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    std::vector<int> v;
+    v.push_back(0);
+    v.pop_back();
+    TEST_LIBCPP_ASSERT_FAILURE(v.pop_back(), "vector::pop_back called on an empty vector");
+
+    return 0;
+}
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 (file)
index 8005841..0000000
+++ /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 (file)
index 99c0e73..0000000
+++ /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 (file)
index 4301dc2..0000000
+++ /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_cback_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cback_2.pass.cpp
deleted file mode 100644 (file)
index d01e440..0000000
+++ /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>
-
-// Call back() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#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;
-  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 (file)
index 73fc4a2..0000000
+++ /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_cfront_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_cfront_2.pass.cpp
deleted file mode 100644 (file)
index 6d0585f..0000000
+++ /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>
-
-// Call front() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <vector>
-
-#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;
-  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/db_cindex.pass.cpp
deleted file mode 100644 (file)
index d41d38d..0000000
+++ /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"
-
-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;
-}
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 (file)
index 1fa2dca..0000000
+++ /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 (file)
index bb2d46e..0000000
+++ /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 (file)
index 17840af..0000000
+++ /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 (file)
index 4f1658e..0000000
+++ /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_index_2.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_index_2.pass.cpp
deleted file mode 100644 (file)
index 687db6c..0000000
+++ /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 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"
-#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");
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_10.pass.cpp
deleted file mode 100644 (file)
index f654dca..0000000
+++ /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>
-
-// Subtract iterators from different containers.
-
-// 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 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_11.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_11.pass.cpp
deleted file mode 100644 (file)
index dc1a589..0000000
+++ /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>
-
-// 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"
-#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");
-
-  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 (file)
index b7eb357..0000000
+++ /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_13.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_13.pass.cpp
deleted file mode 100644 (file)
index 8a069b1..0000000
+++ /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>
-
-// 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"
-#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");
-
-  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 (file)
index 9800610..0000000
+++ /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 (file)
index d585fb3..0000000
+++ /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 (file)
index 8d12f27..0000000
+++ /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 different 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 (file)
index 8cf0535..0000000
+++ /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 different 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 (file)
index 1b466cb..0000000
+++ /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 (file)
index 44ec064..0000000
+++ /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 (file)
index 4ef8f42..0000000
+++ /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 (file)
index 7a55985..0000000
+++ /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 (file)
index 9fce0ce..0000000
+++ /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/db_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/db_iterators_9.pass.cpp
deleted file mode 100644 (file)
index ccdbf48..0000000
+++ /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>
-
-// Compare iterators from different containers with <.
-
-// 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 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/debug.iterator.add.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.add.pass.cpp
new file mode 100644 (file)
index 0000000..5b10424
--- /dev/null
@@ -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/debug.iterator.compare.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.compare.pass.cpp
new file mode 100644 (file)
index 0000000..08042bc
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Compare iterators from different containers with <.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <vector>
+
+#include "check_assertion.h"
+#include "min_allocator.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");
+  }
+
+  {
+    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/debug.iterator.decrement.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.decrement.pass.cpp
new file mode 100644 (file)
index 0000000..2e50c31
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Decrement iterator prior to begin.
+
+// 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.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/sequences/vector/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.dereference.pass.cpp
new file mode 100644 (file)
index 0000000..40c68f9
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Dereference non-dereferenceable iterator.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <vector>
+
+#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::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/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.increment.pass.cpp
new file mode 100644 (file)
index 0000000..3826ca5
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Increment iterator past end.
+
+// 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;
+    assert(i == c.end());
+    TEST_LIBCPP_ASSERT_FAILURE(++i, "Attempted to increment a non-incrementable iterator");
+  }
+
+  {
+    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/debug.iterator.index.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.index.pass.cpp
new file mode 100644 (file)
index 0000000..918417f
--- /dev/null
@@ -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>
+
+// Index 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();
+    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/debug.iterator.subtract.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/debug.iterator.subtract.pass.cpp
new file mode 100644 (file)
index 0000000..4357879
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <vector>
+
+// Subtract iterators from different containers.
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <vector>
+
+#include "check_assertion.h"
+#include "min_allocator.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");
+  }
+
+  {
+    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/sequences/vector/pop_back_empty.pass.cpp b/libcxx/test/libcxx/containers/sequences/vector/pop_back_empty.pass.cpp
deleted file mode 100644 (file)
index cfca9fd..0000000
+++ /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>
-
-// pop_back() more than the number of elements in a vector
-
-// 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**) {
-    std::vector<int> v;
-    v.push_back(0);
-    v.pop_back();
-    TEST_LIBCPP_ASSERT_FAILURE(v.pop_back(), "vector::pop_back called on an empty vector");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket.pass.cpp
new file mode 100644 (file)
index 0000000..faaffea
--- /dev/null
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..fba3e59
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_map
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/assert.max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..9ece4f9
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_map
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/bucket_size.pass.cpp
deleted file mode 100644 (file)
index cdadd45..0000000
+++ /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>
-
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, T>>>
-// class unordered_map
-
-// size_type bucket_size(size_type n) const
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_bucket.pass.cpp
deleted file mode 100644 (file)
index 5c4bb4c..0000000
+++ /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_map>
-
-// size_type bucket(const key_type& __k) const;
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
-
-    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/db_insert_hint_const_lvalue.pass.cpp
deleted file mode 100644 (file)
index 00328a9..0000000
+++ /dev/null
@@ -1,40 +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>
-
-// iterator insert(const_iterator p, const value_type& x);
-
-// 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::unordered_map<double, int> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    P v(3.5, 3);
-#if TEST_STD_VER < 11
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, v),
-        "unordered_map::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_map");
-#else
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, v),
-        "unordered_map::insert(const_iterator, value_type&&) called with an iterator not referring to this unordered_map");
-#endif
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_insert_hint_rvalue.pass.cpp
deleted file mode 100644 (file)
index e716e61..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// 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
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_map<double, int> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, P(3.5, 3)),
-        "unordered_map::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_map");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_10.pass.cpp
deleted file mode 100644 (file)
index 6690f8a..0000000
+++ /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 <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;
-    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_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_iterators_7.pass.cpp
deleted file mode 100644 (file)
index dfb0acb..0000000
+++ /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 (file)
index 7f16d65..0000000
+++ /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 (file)
index 59dc2f3..0000000
+++ /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 (file)
index 3eb7c6c..0000000
+++ /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 (file)
index 7cf1792..0000000
+++ /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 (file)
index 96e6ce9..0000000
+++ /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 (file)
index 8b74859..0000000
+++ /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_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/db_swap_1.pass.cpp
deleted file mode 100644 (file)
index 6735611..0000000
+++ /dev/null
@@ -1,40 +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>
-
-// template <class Key, class Value, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, Value>>>
-// class unordered_map
-
-// void swap(unordered_map& x, unordered_map& y);
-
-// 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(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)};
-    std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
-    std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
-    std::unordered_map<int, int>::iterator i1 = c1.begin();
-    std::unordered_map<int, int>::iterator i2 = c2.begin();
-    swap(c1, c2);
-    c1.erase(i2);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c1.erase(i1), "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/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_const_lvalue.pass.cpp
new file mode 100644 (file)
index 0000000..fe0e356
--- /dev/null
@@ -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>
+
+// iterator insert(const_iterator p, const value_type& x);
+
+// 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"
+
+int main(int, char**) {
+    typedef std::unordered_map<double, int> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    P v(3.5, 3);
+#if TEST_STD_VER < 11
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, v),
+        "unordered_map::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_map");
+#else
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, v),
+        "unordered_map::insert(const_iterator, value_type&&) called with an iterator not referring to this unordered_map");
+#endif
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.insert.hint_rvalue.pass.cpp
new file mode 100644 (file)
index 0000000..27ab809
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <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, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+#include "test_macros.h"
+
+int main(int, char**) {
+    typedef std::unordered_map<double, int> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, P(3.5, 3)),
+        "unordered_map::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_map");
+
+    return 0;
+}
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 (file)
index 0000000..5cae9d3
--- /dev/null
@@ -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 (file)
index 0000000..bb07d6f
--- /dev/null
@@ -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 (file)
index 0000000..d30e610
--- /dev/null
@@ -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 (file)
index 0000000..dcfe2cf
--- /dev/null
@@ -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/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/debug.swap.pass.cpp
new file mode 100644 (file)
index 0000000..b1b8192
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class Value, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, Value>>>
+// class unordered_map
+
+// void swap(unordered_map& x, unordered_map& y);
+
+// 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**) {
+    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)};
+    std::unordered_map<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+    std::unordered_map<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+    std::unordered_map<int, int>::iterator i1 = c1.begin();
+    std::unordered_map<int, int>::iterator i2 = c2.begin();
+    swap(c1, c2);
+    c1.erase(i2);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c1.erase(i1), "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/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.map/max_load_factor.pass.cpp
deleted file mode 100644 (file)
index 1386bf8..0000000
+++ /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>
-
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, T>>>
-// class unordered_map
-
-// float max_load_factor() const;
-// void max_load_factor(float mlf);
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
-
-    return 0;
-}
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 (file)
index 0000000..09a27bb
--- /dev/null
@@ -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 (file)
index 0000000..d8c6b71
--- /dev/null
@@ -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 different 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 different 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 different 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 (file)
index 2463a57..0000000
+++ /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 (file)
index f671be5..0000000
+++ /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 (file)
index 90f50a4..0000000
+++ /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 (file)
index 0080205..0000000
+++ /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 (file)
index 5f3ec83..0000000
+++ /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 (file)
index 6404cf1..0000000
+++ /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/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket.pass.cpp
new file mode 100644 (file)
index 0000000..b0b9fb0
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..1f95e17
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/assert.max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..559ac62
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, T>>>
+// class unordered_multimap
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_map>
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<int, std::string> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/bucket.pass.cpp
deleted file mode 100644 (file)
index d956ac5..0000000
+++ /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>
-
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, T>>>
-// class unordered_multimap
-
-// size_type bucket(const key_type& __k) const;
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/bucket_size.pass.cpp
deleted file mode 100644 (file)
index 1f8e8ff..0000000
+++ /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>
-
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, T>>>
-// class unordered_multimap
-
-// size_type bucket_size(size_type n) const
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
-
-    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/db_insert_hint_const_lvalue.pass.cpp
deleted file mode 100644 (file)
index 623ba1c..0000000
+++ /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>
-
-// iterator insert(const_iterator p, const value_type& x);
-
-// 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::unordered_multimap<double, int> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    P v(3.5, 3);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, v),
-        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_insert_hint_rvalue.pass.cpp
deleted file mode 100644 (file)
index 8641cec..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// 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
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <unordered_map>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**) {
-    typedef std::unordered_multimap<double, int> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, P(3.5, 3)),
-        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
-
-    return 0;
-}
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 (file)
index 42cec31..0000000
+++ /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 (file)
index c9be4cc..0000000
+++ /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 (file)
index dc9a0b6..0000000
+++ /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_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_iterators_9.pass.cpp
deleted file mode 100644 (file)
index b1d0de9..0000000
+++ /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 <cassert>
-#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.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_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_local_iterators_10.pass.cpp
deleted file mode 100644 (file)
index 3658082..0000000
+++ /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 (file)
index d521a9a..0000000
+++ /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 (file)
index 4cc1317..0000000
+++ /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 (file)
index fd1c1e1..0000000
+++ /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_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/db_swap_1.pass.cpp
deleted file mode 100644 (file)
index d8bf7fe..0000000
+++ /dev/null
@@ -1,41 +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>
-
-// template <class Key, class Value, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, Value>>>
-// class unordered_multimap
-
-// void swap(unordered_multimap& x, unordered_multimap& y);
-
-// 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(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)};
-    std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
-    std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
-    std::unordered_multimap<int, int>::iterator i1 = c1.begin();
-    std::unordered_multimap<int, int>::iterator i2 = c2.begin();
-    swap(c1, c2);
-    c1.erase(i2);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c1.erase(i1), "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/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_const_lvalue.pass.cpp
new file mode 100644 (file)
index 0000000..1d5d259
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator p, const value_type& x);
+
+// 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**) {
+    typedef std::unordered_multimap<double, int> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    P v(3.5, 3);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, v),
+        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.insert.hint_rvalue.pass.cpp
new file mode 100644 (file)
index 0000000..b968d38
--- /dev/null
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// 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, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <unordered_map>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multimap<double, int> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, P(3.5, 3)),
+        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
+
+    return 0;
+}
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 (file)
index 0000000..68b873a
--- /dev/null
@@ -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 (file)
index 0000000..139e733
--- /dev/null
@@ -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 (file)
index 0000000..0f6cc20
--- /dev/null
@@ -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 (file)
index 0000000..2acdefb
--- /dev/null
@@ -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/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/debug.swap.pass.cpp
new file mode 100644 (file)
index 0000000..936ba02
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_map>
+
+// template <class Key, class Value, class Hash = hash<Key>, class Pred = equal_to<Key>,
+//           class Alloc = allocator<pair<const Key, Value>>>
+// class unordered_multimap
+
+// void swap(unordered_multimap& x, unordered_multimap& y);
+
+// 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**) {
+    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)};
+    std::unordered_multimap<int, int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+    std::unordered_multimap<int, int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+    std::unordered_multimap<int, int>::iterator i1 = c1.begin();
+    std::unordered_multimap<int, int>::iterator i2 = c2.begin();
+    swap(c1, c2);
+    c1.erase(i2);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c1.erase(i1), "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/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multimap/max_load_factor.pass.cpp
deleted file mode 100644 (file)
index 6f95c95..0000000
+++ /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>
-
-// template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
-//           class Alloc = allocator<pair<const Key, T>>>
-// class unordered_multimap
-
-// float max_load_factor() const;
-// void max_load_factor(float mlf);
-
-// 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;
-    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
-
-    return 0;
-}
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 (file)
index 0000000..17518d3
--- /dev/null
@@ -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 (file)
index 0000000..f07d2db
--- /dev/null
@@ -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 (file)
index acfefc5..0000000
+++ /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 (file)
index 4b62979..0000000
+++ /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 (file)
index edcaf96..0000000
+++ /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 (file)
index c33b515..0000000
+++ /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 (file)
index a50ab9b..0000000
+++ /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 (file)
index cc1a836..0000000
+++ /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/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket.pass.cpp
new file mode 100644 (file)
index 0000000..0350cd3
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..a6c9c31
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/assert.max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..e1d07c8
--- /dev/null
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_multiset<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/bucket.pass.cpp
deleted file mode 100644 (file)
index ac543d1..0000000
+++ /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>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_multiset
-
-// size_type bucket(const key_type& __k) const;
-
-// 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 std::unordered_multiset<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/bucket_size.pass.cpp
deleted file mode 100644 (file)
index 7910713..0000000
+++ /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>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_multiset
-
-// size_type bucket_size(size_type n) const
-
-// 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 std::unordered_multiset<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
-
-    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/db_insert_hint_const_lvalue.pass.cpp
deleted file mode 100644 (file)
index 88108de..0000000
+++ /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_set>
-
-// iterator insert(const_iterator p, const value_type& x);
-
-// 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 std::unordered_multiset<double> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    P v(3.5);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, v),
-        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
-
-    return 0;
-}
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 (file)
index 6f632a0..0000000
+++ /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 (file)
index 591e898..0000000
+++ /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 (file)
index 50a8372..0000000
+++ /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 (file)
index 0d6f6b0..0000000
+++ /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 (file)
index a1a1f20..0000000
+++ /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 (file)
index bc9438d..0000000
+++ /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 (file)
index f597f6a..0000000
+++ /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 (file)
index dce0d77..0000000
+++ /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/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/db_swap_1.pass.cpp
deleted file mode 100644 (file)
index a7f3d84..0000000
+++ /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_set>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_multiset
-
-// void swap(unordered_multiset& x, unordered_multiset& y);
-
-// 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, 3, 7, 9, 10};
-    int a2[] = {0, 2, 4, 5, 6, 8, 11};
-    std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
-    std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
-    std::unordered_multiset<int>::iterator i1 = c1.begin();
-    std::unordered_multiset<int>::iterator i2 = c2.begin();
-    swap(c1, c2);
-    c1.erase(i2);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c1.erase(i1), "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.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.erase.iter.pass.cpp
new file mode 100644 (file)
index 0000000..bdae4da
--- /dev/null
@@ -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 (file)
index 0000000..bb9ee05
--- /dev/null
@@ -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/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.insert.hint_const_lvalue.pass.cpp
new file mode 100644 (file)
index 0000000..d70494a
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator p, const value_type& x);
+
+// 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**) {
+    typedef std::unordered_multiset<double> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    P v(3.5);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, v),
+        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not referring to this unordered container");
+
+    return 0;
+}
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 (file)
index 0000000..0d747d5
--- /dev/null
@@ -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 (file)
index 0000000..aa10eb1
--- /dev/null
@@ -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 (file)
index 0000000..b74488a
--- /dev/null
@@ -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 (file)
index 0000000..a2456ff
--- /dev/null
@@ -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/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/debug.swap.pass.cpp
new file mode 100644 (file)
index 0000000..68c8bbc
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_multiset
+
+// void swap(unordered_multiset& x, unordered_multiset& y);
+
+// 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**) {
+    int a1[] = {1, 3, 7, 9, 10};
+    int a2[] = {0, 2, 4, 5, 6, 8, 11};
+    std::unordered_multiset<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+    std::unordered_multiset<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+    std::unordered_multiset<int>::iterator i1 = c1.begin();
+    std::unordered_multiset<int>::iterator i2 = c2.begin();
+    swap(c1, c2);
+    c1.erase(i2);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c1.erase(i1), "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_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/erase_iter_db1.pass.cpp
deleted file mode 100644 (file)
index 7b37704..0000000
+++ /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 (file)
index bfa8d8d..0000000
+++ /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 (file)
index c468f6b..0000000
+++ /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 (file)
index 626ae92..0000000
+++ /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 (file)
index 195d8a6..0000000
+++ /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 (file)
index d4aa964..0000000
+++ /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.multiset/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.multiset/max_load_factor.pass.cpp
deleted file mode 100644 (file)
index 37c6e0b..0000000
+++ /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>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_multiset
-
-// float max_load_factor() const;
-// void max_load_factor(float mlf);
-
-// 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 std::unordered_multiset<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(0), "unordered container::max_load_factor(lf) called with lf <= 0");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket.pass.cpp
new file mode 100644 (file)
index 0000000..adcd5de
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket(const key_type& __k) const;
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.bucket_size.pass.cpp
new file mode 100644 (file)
index 0000000..1374152
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// size_type bucket_size(size_type n) const
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/assert.max_load_factor.pass.cpp
new file mode 100644 (file)
index 0000000..e0c98ed
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// float max_load_factor() const;
+// void max_load_factor(float mlf);
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <unordered_set>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::unordered_set<int> C;
+    C c;
+    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(-0.5f),
+                               "unordered container::max_load_factor(lf) called with lf <= 0");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/bucket.pass.cpp
deleted file mode 100644 (file)
index 8abe885..0000000
+++ /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>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_set
-
-// size_type bucket(const key_type& __k) const;
-
-// 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 std::unordered_set<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket(3), "unordered container::bucket(key) called when bucket_count() == 0");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/bucket_size.pass.cpp
deleted file mode 100644 (file)
index e83440e..0000000
+++ /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>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_set
-
-// size_type bucket_size(size_type n) const
-
-// 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 std::unordered_set<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.bucket_size(3), "unordered container::bucket_size(n) called with n >= bucket_count()");
-
-    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/db_insert_hint_const_lvalue.pass.cpp
deleted file mode 100644 (file)
index 4c00e28..0000000
+++ /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_set>
-
-// iterator insert(const_iterator p, const value_type& x);
-
-// 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 std::unordered_set<double> C;
-    typedef C::value_type P;
-    C c;
-    C c2;
-    C::const_iterator e = c2.end();
-    P v(3.5);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c.insert(e, v),
-        "unordered_set::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_set");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_10.pass.cpp
deleted file mode 100644 (file)
index 3d5acd3..0000000
+++ /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_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/db_iterators_7.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_7.pass.cpp
deleted file mode 100644 (file)
index a894b76..0000000
+++ /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 (file)
index c874de8..0000000
+++ /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_iterators_9.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_iterators_9.pass.cpp
deleted file mode 100644 (file)
index aaa3669..0000000
+++ /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_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/db_local_iterators_10.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_local_iterators_10.pass.cpp
deleted file mode 100644 (file)
index 8cb01cd..0000000
+++ /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 (file)
index 0082d83..0000000
+++ /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 (file)
index b5ea940..0000000
+++ /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 (file)
index 70a4140..0000000
+++ /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/db_swap_1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/db_swap_1.pass.cpp
deleted file mode 100644 (file)
index ec66313..0000000
+++ /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_set>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_set
-
-// void swap(unordered_set& x, unordered_set& y);
-
-// 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, 3, 7, 9, 10};
-    int a2[] = {0, 2, 4, 5, 6, 8, 11};
-    std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
-    std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
-    std::unordered_set<int>::iterator i1 = c1.begin();
-    std::unordered_set<int>::iterator i2 = c2.begin();
-    swap(c1, c2);
-    c1.erase(i2);
-    TEST_LIBCPP_ASSERT_FAILURE(
-        c1.erase(i1), "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.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.erase.iter.pass.cpp
new file mode 100644 (file)
index 0000000..7e8d7e5
--- /dev/null
@@ -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 (file)
index 0000000..1d8a5eb
--- /dev/null
@@ -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/debug.insert.hint_const_lvalue.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.insert.hint_const_lvalue.pass.cpp
new file mode 100644 (file)
index 0000000..2fe2580
--- /dev/null
@@ -0,0 +1,32 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator p, const value_type& x);
+
+// 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**) {
+    typedef std::unordered_set<double> C;
+    typedef C::value_type P;
+    C c;
+    C c2;
+    C::const_iterator e = c2.end();
+    P v(3.5);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c.insert(e, v),
+        "unordered_set::insert(const_iterator, const value_type&) called with an iterator not referring to this unordered_set");
+
+    return 0;
+}
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 (file)
index 0000000..c7f1bc6
--- /dev/null
@@ -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 (file)
index 0000000..9466130
--- /dev/null
@@ -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 (file)
index 0000000..4df9f6c
--- /dev/null
@@ -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 (file)
index 0000000..aa48b31
--- /dev/null
@@ -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/debug.swap.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/debug.swap.pass.cpp
new file mode 100644 (file)
index 0000000..a0ef6a1
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <unordered_set>
+
+// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
+//           class Alloc = allocator<Value>>
+// class unordered_set
+
+// void swap(unordered_set& x, unordered_set& y);
+
+// 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**) {
+    int a1[] = {1, 3, 7, 9, 10};
+    int a2[] = {0, 2, 4, 5, 6, 8, 11};
+    std::unordered_set<int> c1(a1, a1+sizeof(a1)/sizeof(a1[0]));
+    std::unordered_set<int> c2(a2, a2+sizeof(a2)/sizeof(a2[0]));
+    std::unordered_set<int>::iterator i1 = c1.begin();
+    std::unordered_set<int>::iterator i2 = c2.begin();
+    swap(c1, c2);
+    c1.erase(i2);
+    TEST_LIBCPP_ASSERT_FAILURE(
+        c1.erase(i1), "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_db1.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/erase_iter_db1.pass.cpp
deleted file mode 100644 (file)
index 0aca919..0000000
+++ /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 (file)
index 694bde8..0000000
+++ /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 (file)
index 5d7b104..0000000
+++ /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 (file)
index 9e06601..0000000
+++ /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 (file)
index 7bd88eb..0000000
+++ /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 (file)
index b9c4043..0000000
+++ /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/containers/unord/unord.set/max_load_factor.pass.cpp b/libcxx/test/libcxx/containers/unord/unord.set/max_load_factor.pass.cpp
deleted file mode 100644 (file)
index c4514d1..0000000
+++ /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_set>
-
-// template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
-//           class Alloc = allocator<Value>>
-// class unordered_set
-
-// float max_load_factor() const;
-// void max_load_factor(float mlf);
-
-// 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 std::unordered_set<int> C;
-    C c;
-    TEST_LIBCPP_ASSERT_FAILURE(c.max_load_factor(-0.5f),
-                               "unordered container::max_load_factor(lf) called with lf <= 0");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/debug/check_assertion_test.pass.cpp b/libcxx/test/libcxx/debug/check_assertion_test.pass.cpp
new file mode 100644 (file)
index 0000000..ecce86e
--- /dev/null
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <__debug>
+#include <cstdio>
+
+#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) {
+  DeathTest DT(Matcher);
+  DeathTest::ResultKind RK = DT.Run(func);
+  auto OnFailure = [&](std::string msg) {
+    std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg.c_str());
+    if (!DT.getChildStdErr().empty()) {
+      std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str());
+    }
+    if (!DT.getChildStdOut().empty()) {
+      std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str());
+    }
+    return false;
+  };
+  if (RK != ExpectResult)
+    return OnFailure(std::string("expected result did not occur: expected ") + DeathTest::ResultKindToString(ExpectResult) + " got: " + DeathTest::ResultKindToString(RK));
+  return true;
+}
+#define TEST_DEATH_TEST(RK, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, AnyMatcher )))
+
+#define TEST_DEATH_TEST_MATCHES(RK, Matcher, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, Matcher)))
+
+void my_libcpp_assert() {
+  _LIBCPP_ASSERT(false, "other");
+}
+
+void test_no_match_found() {
+  DebugInfoMatcher ExpectMatch("my message");
+  TEST_DEATH_TEST_MATCHES(DeathTest::RK_MatchFailure, ExpectMatch, my_libcpp_assert());
+}
+
+void test_did_not_die() {
+  TEST_DEATH_TEST(DeathTest::RK_DidNotDie, ((void)0));
+}
+
+void test_unknown() {
+  TEST_DEATH_TEST(DeathTest::RK_Unknown, std::exit(13));
+}
+
+int main(int, char**) {
+  test_no_match_found();
+  test_did_not_die();
+  test_unknown();
+  return 0;
+}
diff --git a/libcxx/test/libcxx/debug/containers.multithread.pass.cpp b/libcxx/test/libcxx/debug/containers.multithread.pass.cpp
new file mode 100644 (file)
index 0000000..6cc9eff
--- /dev/null
@@ -0,0 +1,66 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcpp-has-no-threads
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+// test multithreaded container debugging
+
+#include <cassert>
+#include <cstddef>
+#include <deque>
+#include <list>
+#include <thread>
+#include <vector>
+
+template <typename Container>
+Container makeContainer(int size) {
+  Container c;
+  typedef typename Container::value_type ValueType;
+  for (int i = 0; i < size; ++i)
+    c.insert(c.end(), ValueType(i));
+  assert(c.size() == static_cast<std::size_t>(size));
+  return c;
+}
+
+template <typename Container>
+void ThreadUseIter() {
+  const size_t maxRounds = 7;
+  struct TestRunner{
+    void operator()() {
+      for (size_t count = 0; count < maxRounds; count++) {
+        const size_t containerCount = 11;
+        std::vector<Container> containers;
+        std::vector<typename Container::iterator> iterators;
+        for (size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
+          containers.push_back(makeContainer<Container>(3));
+          Container& c = containers.back();
+          iterators.push_back(c.begin());
+          iterators.push_back(c.end());
+        }
+      }
+    }
+  };
+
+  TestRunner r;
+  const size_t threadCount = 4;
+  std::vector<std::thread> threads;
+  for (size_t count = 0; count < threadCount; count++)
+    threads.emplace_back(r);
+  r();
+  for (size_t count = 0; count < threadCount; count++)
+    threads[count].join();
+}
+
+int main(int, char**) {
+  ThreadUseIter<std::vector<int> >();
+  return 0;
+}
diff --git a/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp b/libcxx/test/libcxx/debug/containers/associative_containers.pass.cpp
new file mode 100644 (file)
index 0000000..c5f8285
--- /dev/null
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+// test container debugging
+
+#include <map>
+#include <set>
+#include <utility>
+#include <cassert>
+#include "check_assertion.h"
+#include "container_debug_tests.h"
+#include "test_macros.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct AssociativeContainerChecks : BasicContainerChecks<Container, CT> {
+  using Base = BasicContainerChecks<Container, CT>;
+  using value_type = typename Container::value_type;
+  using iterator = typename Container::iterator;
+  using const_iterator = typename Container::const_iterator;
+  using traits = std::iterator_traits<iterator>;
+  using category = typename traits::iterator_category;
+
+  using Base::makeContainer;
+public:
+  static void run() {
+    Base::run();
+  }
+
+private:
+  // FIXME Add tests here
+};
+
+int main(int, char**)
+{
+  using SetAlloc = test_allocator<int>;
+  using MapAlloc = test_allocator<std::pair<const int, int>>;
+  // FIXME: Add debug mode to these containers
+  if ((false)) {
+    AssociativeContainerChecks<
+        std::set<int, std::less<int>, SetAlloc>, CT_Set>::run();
+    AssociativeContainerChecks<
+        std::multiset<int, std::less<int>, SetAlloc>, CT_MultiSet>::run();
+    AssociativeContainerChecks<
+        std::map<int, int, std::less<int>, MapAlloc>, CT_Map>::run();
+    AssociativeContainerChecks<
+        std::multimap<int, int, std::less<int>, MapAlloc>, CT_MultiMap>::run();
+  }
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp b/libcxx/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
deleted file mode 100644 (file)
index e678e16..0000000
+++ /dev/null
@@ -1,63 +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 <map>
-#include <set>
-#include <utility>
-#include <cassert>
-#include "container_debug_tests.h"
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-using namespace IteratorDebugChecks;
-
-template <class Container, ContainerType CT>
-struct AssociativeContainerChecks : BasicContainerChecks<Container, CT> {
-  using Base = BasicContainerChecks<Container, CT>;
-  using value_type = typename Container::value_type;
-  using iterator = typename Container::iterator;
-  using const_iterator = typename Container::const_iterator;
-  using traits = std::iterator_traits<iterator>;
-  using category = typename traits::iterator_category;
-
-  using Base::makeContainer;
-public:
-  static void run() {
-    Base::run();
-  }
-
-private:
-  // FIXME Add tests here
-};
-
-int main(int, char**)
-{
-  using SetAlloc = test_allocator<int>;
-  using MapAlloc = test_allocator<std::pair<const int, int>>;
-  // FIXME: Add debug mode to these containers
-  if ((false)) {
-    AssociativeContainerChecks<
-        std::set<int, std::less<int>, SetAlloc>, CT_Set>::run();
-    AssociativeContainerChecks<
-        std::multiset<int, std::less<int>, SetAlloc>, CT_MultiSet>::run();
-    AssociativeContainerChecks<
-        std::map<int, int, std::less<int>, MapAlloc>, CT_Map>::run();
-    AssociativeContainerChecks<
-        std::multimap<int, int, std::less<int>, MapAlloc>, CT_MultiMap>::run();
-  }
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp b/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.multithread.pass.cpp
deleted file mode 100644 (file)
index 70d92e8..0000000
+++ /dev/null
@@ -1,71 +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
-// UNSUPPORTED: libcpp-has-no-threads
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// test multihtreaded container debugging
-
-#include <cassert>
-#include <cstddef>
-#include <deque>
-#include <list>
-#include <thread>
-#include <vector>
-#include "container_debug_tests.h"
-
-#include "test_macros.h"
-
-
-template <typename Container>
-Container makeContainer(int size) {
-  Container c;
-  typedef typename Container::value_type ValueType;
-  for (int i = 0; i < size; ++i)
-    c.insert(c.end(), ValueType(i));
-  assert(c.size() == static_cast<std::size_t>(size));
-  return c;
-}
-
-template <typename Container>
-void ThreadUseIter() {
-  const size_t maxRounds = 7;
-  struct TestRunner{
-    void operator()() {
-      for (size_t count = 0; count < maxRounds; count++) {
-        const size_t containerCount = 11;
-        std::vector<Container> containers;
-        std::vector<typename Container::iterator> iterators;
-        for (size_t containerIndex = 0; containerIndex < containerCount; containerIndex++) {
-          containers.push_back(makeContainer<Container>(3));
-          Container& c = containers.back();
-          iterators.push_back(c.begin());
-          iterators.push_back(c.end());
-        }
-      }
-    }
-  };
-
-  TestRunner r;
-  const size_t threadCount = 4;
-  std::vector<std::thread> threads;
-  for (size_t count = 0; count < threadCount; count++)
-    threads.emplace_back(r);
-  r();
-  for (size_t count = 0; count < threadCount; count++)
-    threads[count].join();
-}
-
-int main(int, char**) {
-  ThreadUseIter<std::vector<int> >();
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/libcxx/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
deleted file mode 100644 (file)
index 7b82a70..0000000
+++ /dev/null
@@ -1,336 +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 <forward_list>
-#include <list>
-#include <vector>
-#include <deque>
-#include "container_debug_tests.h"
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-using namespace IteratorDebugChecks;
-
-template <class Container, ContainerType CT>
-struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
-  using Base = BasicContainerChecks<Container, CT>;
-  using value_type = typename Container::value_type;
-  using allocator_type = typename Container::allocator_type;
-  using iterator = typename Container::iterator;
-  using const_iterator = typename Container::const_iterator;
-
-  using Base::makeContainer;
-  using Base::makeValueType;
-public:
-  static void run() {
-    Base::run();
-    SanityTest();
-    FrontOnEmptyContainer();
-
-    if constexpr(CT != CT_ForwardList) {
-        AssignInvalidates();
-        BackOnEmptyContainer();
-        InsertIterValue();
-        InsertIterSizeValue();
-        InsertIterIterIter();
-        EmplaceIterValue();
-        EraseIterIter();
-      }
-    else {
-      SpliceFirstElemAfter();
-    }
-    if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
-      PopBack();
-    }
-    if constexpr (CT == CT_List || CT == CT_Deque) {
-      PopFront(); // FIXME: Run with forward list as well
-    }
-    if constexpr (CT == CT_List || CT == CT_ForwardList) {
-      RemoveFirstElem();
-    }
-    if constexpr (CT == CT_List) {
-      SpliceFirstElem();
-      SpliceSameContainer();
-    }
-  }
-
-private:
-  static void SanityTest() {
-    // sanity test
-    Container C = {1, 1, 1, 1};
-    ::DoNotOptimize(&C);
-  }
-
-  static void RemoveFirstElem() {
-    // See llvm.org/PR35564
-    // remove(<first-elem>)
-    {
-      Container C = makeContainer(1);
-      auto FirstVal = *(C.begin());
-      C.remove(FirstVal);
-      assert(C.empty());
-    }
-    {
-      Container C = {1, 1, 1, 1};
-      auto FirstVal = *(C.begin());
-      C.remove(FirstVal);
-      assert(C.empty());
-    }
-  }
-
-  static void SpliceFirstElem() {
-    // See llvm.org/PR35564
-    // splice(<first-elem>)
-    {
-      Container C = makeContainer(1);
-      Container C2;
-      C2.splice(C2.end(), C, C.begin(), ++C.begin());
-    }
-    {
-      Container C = makeContainer(1);
-      Container C2;
-      C2.splice(C2.end(), C, C.begin());
-    }
-  }
-
-  static void SpliceSameContainer() {
-    // splice(<same-container>)
-    Container C = {1, 1};
-    C.splice(C.end(), C, C.begin());
-  }
-
-  static void SpliceFirstElemAfter() {
-    // See llvm.org/PR35564
-    // splice(<first-elem>)
-    {
-      Container C = makeContainer(1);
-      Container C2;
-      C2.splice_after(C2.begin(), C, C.begin(), ++C.begin());
-    }
-    {
-      Container C = makeContainer(1);
-      Container C2;
-      C2.splice_after(C2.begin(), C, C.begin());
-    }
-  }
-
-  static void AssignInvalidates() {
-    // assign(Size, Value)
-    Container C(allocator_type{});
-    iterator it1, it2, it3;
-    auto reset = [&]() {
-      C = makeContainer(3);
-      it1 = C.begin();
-      it2 = ++C.begin();
-      it3 = C.end();
-    };
-    auto check = [&]() {
-      EXPECT_DEATH( C.erase(it1) );
-      EXPECT_DEATH( C.erase(it2) );
-      EXPECT_DEATH( C.erase(it3, C.end()) );
-    };
-    reset();
-    C.assign(2, makeValueType(4));
-    check();
-    reset();
-    // assign(Iter, Iter)
-    std::vector<value_type> V = {
-        makeValueType(1),
-        makeValueType(2),
-        makeValueType(3)
-    };
-    C.assign(V.begin(), V.end());
-    check();
-    reset();
-    // assign(initializer_list)
-    C.assign({makeValueType(1), makeValueType(2), makeValueType(3)});
-    check();
-  }
-
-  static void BackOnEmptyContainer() {
-    // testing back on empty
-    Container C = makeContainer(1);
-    Container const& CC = C;
-    (void)C.back();
-    (void)CC.back();
-    C.clear();
-    EXPECT_DEATH( C.back() );
-    EXPECT_DEATH( CC.back() );
-  }
-
-  static void FrontOnEmptyContainer() {
-    // testing front on empty
-    Container C = makeContainer(1);
-    Container const& CC = C;
-    (void)C.front();
-    (void)CC.front();
-    C.clear();
-    EXPECT_DEATH( C.front() );
-    EXPECT_DEATH( CC.front() );
-  }
-
-  static void EraseIterIter() {
-    // testing erase iter iter invalidation
-    Container C1 = makeContainer(3);
-    iterator it1 = C1.begin();
-    iterator it1_next = ++C1.begin();
-    iterator it1_after_next = ++C1.begin();
-    ++it1_after_next;
-    iterator it1_back = --C1.end();
-    assert(it1_next != it1_back);
-    if (CT == CT_Vector) {
-      EXPECT_DEATH( C1.erase(it1_next, it1) ); // bad range
-    }
-    C1.erase(it1, it1_after_next);
-    EXPECT_DEATH( C1.erase(it1) );
-    EXPECT_DEATH( C1.erase(it1_next) );
-    if (CT == CT_List) {
-      C1.erase(it1_back);
-    } else {
-      EXPECT_DEATH( C1.erase(it1_back) );
-    }
-  }
-
-  static void PopBack() {
-    // testing  pop_back() invalidation
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.end();
-    --it1;
-    C1.pop_back();
-    EXPECT_DEATH( C1.erase(it1) );
-    C1.erase(C1.begin());
-    assert(C1.size() == 0);
-    EXPECT_DEATH( C1.pop_back() );
-  }
-
-  static void PopFront() {
-    // testing pop_front() invalidation
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.begin();
-    C1.pop_front();
-    EXPECT_DEATH( C1.erase(it1) );
-    C1.erase(C1.begin());
-    assert(C1.size() == 0);
-    EXPECT_DEATH( C1.pop_front() );
-  }
-
-  static void InsertIterValue() {
-    // testing insert(iter, value)
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.begin();
-    iterator it1_next = it1;
-    ++it1_next;
-    Container C2 = C1;
-    const value_type value = makeValueType(3);
-    value_type rvalue = makeValueType(3);
-    EXPECT_DEATH( C2.insert(it1, value) ); // wrong container
-    EXPECT_DEATH( C2.insert(it1, std::move(rvalue)) ); // wrong container
-    C1.insert(it1_next, value);
-    if  (CT == CT_List) {
-      C1.insert(it1_next, value);
-      C1.insert(it1, value);
-      C1.insert(it1_next, std::move(rvalue));
-      C1.insert(it1, std::move(rvalue));
-    } else {
-      EXPECT_DEATH( C1.insert(it1_next, value) ); // invalidated iterator
-      EXPECT_DEATH( C1.insert(it1, value) ); // invalidated iterator
-      EXPECT_DEATH( C1.insert(it1_next, std::move(rvalue)) ); // invalidated iterator
-      EXPECT_DEATH( C1.insert(it1, std::move(rvalue)) ); // invalidated iterator
-    }
-  }
-
-  static void EmplaceIterValue() {
-    // testing emplace(iter, value)
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.begin();
-    iterator it1_next = it1;
-    ++it1_next;
-    Container C2 = C1;
-    const value_type value = makeValueType(3);
-    EXPECT_DEATH( C2.emplace(it1, value) ); // wrong container
-    EXPECT_DEATH( C2.emplace(it1, makeValueType(4)) ); // wrong container
-    C1.emplace(it1_next, value);
-    if  (CT == CT_List) {
-      C1.emplace(it1_next, value);
-      C1.emplace(it1, value);
-    } else {
-      EXPECT_DEATH( C1.emplace(it1_next, value) ); // invalidated iterator
-      EXPECT_DEATH( C1.emplace(it1, value) ); // invalidated iterator
-    }
-  }
-
-  static void InsertIterSizeValue() {
-    // testing insert(iter, size, value)
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.begin();
-    iterator it1_next = it1;
-    ++it1_next;
-    Container C2 = C1;
-    const value_type value = makeValueType(3);
-    EXPECT_DEATH( C2.insert(it1, 1, value) ); // wrong container
-    C1.insert(it1_next, 2, value);
-    if  (CT == CT_List) {
-      C1.insert(it1_next, 3, value);
-      C1.insert(it1, 1, value);
-    } else {
-      EXPECT_DEATH( C1.insert(it1_next, 1, value) ); // invalidated iterator
-      EXPECT_DEATH( C1.insert(it1, 1, value) ); // invalidated iterator
-    }
-  }
-
-  static void InsertIterIterIter() {
-    // testing insert(iter, iter, iter)
-    Container C1 = makeContainer(2);
-    iterator it1 = C1.begin();
-    iterator it1_next = it1;
-    ++it1_next;
-    Container C2 = C1;
-    std::vector<value_type> V = {
-        makeValueType(1),
-        makeValueType(2),
-        makeValueType(3)
-    };
-    EXPECT_DEATH( C2.insert(it1, V.begin(), V.end()) ); // wrong container
-    C1.insert(it1_next, V.begin(), V.end());
-    if  (CT == CT_List) {
-      C1.insert(it1_next, V.begin(), V.end());
-      C1.insert(it1, V.begin(), V.end());
-    } else {
-      EXPECT_DEATH( C1.insert(it1_next, V.begin(), V.end()) ); // invalidated iterator
-      EXPECT_DEATH( C1.insert(it1, V.begin(), V.end()) ); // invalidated iterator
-    }
-  }
-};
-
-int main(int, char**)
-{
-  using Alloc = test_allocator<int>;
-  {
-    SequenceContainerChecks<std::list<int, Alloc>, CT_List>::run();
-    SequenceContainerChecks<std::vector<int, Alloc>, CT_Vector>::run();
-  }
-  // FIXME these containers don't support iterator debugging
-  if ((false)) {
-    SequenceContainerChecks<
-        std::vector<bool, test_allocator<bool>>, CT_VectorBool>::run();
-    SequenceContainerChecks<
-        std::forward_list<int, Alloc>, CT_ForwardList>::run();
-    SequenceContainerChecks<
-        std::deque<int, Alloc>, CT_Deque>::run();
-  }
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/containers/db_string.pass.cpp b/libcxx/test/libcxx/debug/containers/db_string.pass.cpp
deleted file mode 100644 (file)
index f74529c..0000000
+++ /dev/null
@@ -1,95 +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>
-#include <vector>
-
-#include "test_macros.h"
-#include "container_debug_tests.h"
-#include "debug_mode_helper.h"
-
-using namespace IteratorDebugChecks;
-
-typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>>  StringType;
-
-template <class Container = StringType, ContainerType CT = CT_String>
-struct StringContainerChecks : BasicContainerChecks<Container, CT> {
-  using Base = BasicContainerChecks<Container, CT_String>;
-  using value_type = typename Container::value_type;
-  using allocator_type = typename Container::allocator_type;
-  using iterator = typename Container::iterator;
-  using const_iterator = typename Container::const_iterator;
-
-  using Base::makeContainer;
-  using Base::makeValueType;
-
-public:
-  static void run() {
-    Base::run_iterator_tests();
-    Base::run_allocator_aware_tests();
-
-    for (int N : {3, 128}) {
-      FrontOnEmptyContainer(N);
-      BackOnEmptyContainer(N);
-      PopBack(N);
-    }
-  }
-
-private:
-  static void BackOnEmptyContainer(int N) {
-    // testing back on empty
-    Container C = makeContainer(N);
-    Container const& CC = C;
-    iterator it = --C.end();
-    (void)C.back();
-    (void)CC.back();
-    C.pop_back();
-    EXPECT_DEATH( C.erase(it) );
-    C.clear();
-    EXPECT_DEATH( C.back() );
-    EXPECT_DEATH( CC.back() );
-  }
-
-  static void FrontOnEmptyContainer(int N) {
-    // testing front on empty
-    Container C = makeContainer(N);
-    Container const& CC = C;
-    (void)C.front();
-    (void)CC.front();
-    C.clear();
-    EXPECT_DEATH( C.front() );
-    EXPECT_DEATH( CC.front() );
-  }
-
-  static void PopBack(int N) {
-    // testing pop_back() invalidation
-    Container C1 = makeContainer(N);
-    iterator it1 = C1.end();
-    --it1;
-    C1.pop_back();
-    EXPECT_DEATH( C1.erase(it1) );
-    C1.erase(C1.begin(), C1.end());
-    assert(C1.size() == 0);
-    EXPECT_DEATH_MATCHES(DebugInfoMatcher("string::pop_back(): string is already empty"), C1.pop_back() );
-  }
-};
-
-int main(int, char**)
-{
-  StringContainerChecks<>::run();
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp b/libcxx/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
deleted file mode 100644 (file)
index 979070c..0000000
+++ /dev/null
@@ -1,65 +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 <unordered_map>
-#include <unordered_set>
-#include <utility>
-#include <cassert>
-#include "container_debug_tests.h"
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-using namespace IteratorDebugChecks;
-
-template <class Container, ContainerType CT>
-struct UnorderedContainerChecks : BasicContainerChecks<Container, CT> {
-  using Base = BasicContainerChecks<Container, CT>;
-  using value_type = typename Container::value_type;
-  using iterator = typename Container::iterator;
-  using const_iterator = typename Container::const_iterator;
-  using traits = std::iterator_traits<iterator>;
-  using category = typename traits::iterator_category;
-
-  using Base::makeContainer;
-public:
-  static void run() {
-    Base::run();
-  }
-private:
-
-};
-
-int main(int, char**)
-{
-  using SetAlloc = test_allocator<int>;
-  using MapAlloc = test_allocator<std::pair<const int, int>>;
-  {
-    UnorderedContainerChecks<
-        std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
-        CT_UnorderedMap>::run();
-    UnorderedContainerChecks<
-        std::unordered_set<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
-        CT_UnorderedSet>::run();
-    UnorderedContainerChecks<
-        std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
-        CT_UnorderedMultiMap>::run();
-    UnorderedContainerChecks<
-        std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
-        CT_UnorderedMultiSet>::run();
-  }
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp b/libcxx/test/libcxx/debug/containers/sequence_container_iterators.pass.cpp
new file mode 100644 (file)
index 0000000..a9692af
--- /dev/null
@@ -0,0 +1,335 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+// test container debugging
+
+#include <forward_list>
+#include <list>
+#include <vector>
+#include <deque>
+#include "check_assertion.h"
+#include "container_debug_tests.h"
+#include "test_macros.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct SequenceContainerChecks : BasicContainerChecks<Container, CT> {
+  using Base = BasicContainerChecks<Container, CT>;
+  using value_type = typename Container::value_type;
+  using allocator_type = typename Container::allocator_type;
+  using iterator = typename Container::iterator;
+  using const_iterator = typename Container::const_iterator;
+
+  using Base::makeContainer;
+  using Base::makeValueType;
+public:
+  static void run() {
+    Base::run();
+    SanityTest();
+    FrontOnEmptyContainer();
+
+    if constexpr(CT != CT_ForwardList) {
+        AssignInvalidates();
+        BackOnEmptyContainer();
+        InsertIterValue();
+        InsertIterSizeValue();
+        InsertIterIterIter();
+        EmplaceIterValue();
+        EraseIterIter();
+      }
+    else {
+      SpliceFirstElemAfter();
+    }
+    if constexpr (CT == CT_Vector || CT == CT_Deque || CT == CT_List) {
+      PopBack();
+    }
+    if constexpr (CT == CT_List || CT == CT_Deque) {
+      PopFront(); // FIXME: Run with forward list as well
+    }
+    if constexpr (CT == CT_List || CT == CT_ForwardList) {
+      RemoveFirstElem();
+    }
+    if constexpr (CT == CT_List) {
+      SpliceFirstElem();
+      SpliceSameContainer();
+    }
+  }
+
+private:
+  static void SanityTest() {
+    // sanity test
+    Container C = {1, 1, 1, 1};
+    ::DoNotOptimize(&C);
+  }
+
+  static void RemoveFirstElem() {
+    // See llvm.org/PR35564
+    // remove(<first-elem>)
+    {
+      Container C = makeContainer(1);
+      auto FirstVal = *(C.begin());
+      C.remove(FirstVal);
+      assert(C.empty());
+    }
+    {
+      Container C = {1, 1, 1, 1};
+      auto FirstVal = *(C.begin());
+      C.remove(FirstVal);
+      assert(C.empty());
+    }
+  }
+
+  static void SpliceFirstElem() {
+    // See llvm.org/PR35564
+    // splice(<first-elem>)
+    {
+      Container C = makeContainer(1);
+      Container C2;
+      C2.splice(C2.end(), C, C.begin(), ++C.begin());
+    }
+    {
+      Container C = makeContainer(1);
+      Container C2;
+      C2.splice(C2.end(), C, C.begin());
+    }
+  }
+
+  static void SpliceSameContainer() {
+    // splice(<same-container>)
+    Container C = {1, 1};
+    C.splice(C.end(), C, C.begin());
+  }
+
+  static void SpliceFirstElemAfter() {
+    // See llvm.org/PR35564
+    // splice(<first-elem>)
+    {
+      Container C = makeContainer(1);
+      Container C2;
+      C2.splice_after(C2.begin(), C, C.begin(), ++C.begin());
+    }
+    {
+      Container C = makeContainer(1);
+      Container C2;
+      C2.splice_after(C2.begin(), C, C.begin());
+    }
+  }
+
+  static void AssignInvalidates() {
+    // assign(Size, Value)
+    Container C(allocator_type{});
+    iterator it1, it2, it3;
+    auto reset = [&]() {
+      C = makeContainer(3);
+      it1 = C.begin();
+      it2 = ++C.begin();
+      it3 = C.end();
+    };
+    auto check = [&]() {
+      EXPECT_DEATH( C.erase(it1) );
+      EXPECT_DEATH( C.erase(it2) );
+      EXPECT_DEATH( C.erase(it3, C.end()) );
+    };
+    reset();
+    C.assign(2, makeValueType(4));
+    check();
+    reset();
+    // assign(Iter, Iter)
+    std::vector<value_type> V = {
+        makeValueType(1),
+        makeValueType(2),
+        makeValueType(3)
+    };
+    C.assign(V.begin(), V.end());
+    check();
+    reset();
+    // assign(initializer_list)
+    C.assign({makeValueType(1), makeValueType(2), makeValueType(3)});
+    check();
+  }
+
+  static void BackOnEmptyContainer() {
+    // testing back on empty
+    Container C = makeContainer(1);
+    Container const& CC = C;
+    (void)C.back();
+    (void)CC.back();
+    C.clear();
+    EXPECT_DEATH( C.back() );
+    EXPECT_DEATH( CC.back() );
+  }
+
+  static void FrontOnEmptyContainer() {
+    // testing front on empty
+    Container C = makeContainer(1);
+    Container const& CC = C;
+    (void)C.front();
+    (void)CC.front();
+    C.clear();
+    EXPECT_DEATH( C.front() );
+    EXPECT_DEATH( CC.front() );
+  }
+
+  static void EraseIterIter() {
+    // testing erase iter iter invalidation
+    Container C1 = makeContainer(3);
+    iterator it1 = C1.begin();
+    iterator it1_next = ++C1.begin();
+    iterator it1_after_next = ++C1.begin();
+    ++it1_after_next;
+    iterator it1_back = --C1.end();
+    assert(it1_next != it1_back);
+    if (CT == CT_Vector) {
+      EXPECT_DEATH( C1.erase(it1_next, it1) ); // bad range
+    }
+    C1.erase(it1, it1_after_next);
+    EXPECT_DEATH( C1.erase(it1) );
+    EXPECT_DEATH( C1.erase(it1_next) );
+    if (CT == CT_List) {
+      C1.erase(it1_back);
+    } else {
+      EXPECT_DEATH( C1.erase(it1_back) );
+    }
+  }
+
+  static void PopBack() {
+    // testing  pop_back() invalidation
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.end();
+    --it1;
+    C1.pop_back();
+    EXPECT_DEATH( C1.erase(it1) );
+    C1.erase(C1.begin());
+    assert(C1.size() == 0);
+    EXPECT_DEATH( C1.pop_back() );
+  }
+
+  static void PopFront() {
+    // testing pop_front() invalidation
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.begin();
+    C1.pop_front();
+    EXPECT_DEATH( C1.erase(it1) );
+    C1.erase(C1.begin());
+    assert(C1.size() == 0);
+    EXPECT_DEATH( C1.pop_front() );
+  }
+
+  static void InsertIterValue() {
+    // testing insert(iter, value)
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.begin();
+    iterator it1_next = it1;
+    ++it1_next;
+    Container C2 = C1;
+    const value_type value = makeValueType(3);
+    value_type rvalue = makeValueType(3);
+    EXPECT_DEATH( C2.insert(it1, value) ); // wrong container
+    EXPECT_DEATH( C2.insert(it1, std::move(rvalue)) ); // wrong container
+    C1.insert(it1_next, value);
+    if  (CT == CT_List) {
+      C1.insert(it1_next, value);
+      C1.insert(it1, value);
+      C1.insert(it1_next, std::move(rvalue));
+      C1.insert(it1, std::move(rvalue));
+    } else {
+      EXPECT_DEATH( C1.insert(it1_next, value) ); // invalidated iterator
+      EXPECT_DEATH( C1.insert(it1, value) ); // invalidated iterator
+      EXPECT_DEATH( C1.insert(it1_next, std::move(rvalue)) ); // invalidated iterator
+      EXPECT_DEATH( C1.insert(it1, std::move(rvalue)) ); // invalidated iterator
+    }
+  }
+
+  static void EmplaceIterValue() {
+    // testing emplace(iter, value)
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.begin();
+    iterator it1_next = it1;
+    ++it1_next;
+    Container C2 = C1;
+    const value_type value = makeValueType(3);
+    EXPECT_DEATH( C2.emplace(it1, value) ); // wrong container
+    EXPECT_DEATH( C2.emplace(it1, makeValueType(4)) ); // wrong container
+    C1.emplace(it1_next, value);
+    if  (CT == CT_List) {
+      C1.emplace(it1_next, value);
+      C1.emplace(it1, value);
+    } else {
+      EXPECT_DEATH( C1.emplace(it1_next, value) ); // invalidated iterator
+      EXPECT_DEATH( C1.emplace(it1, value) ); // invalidated iterator
+    }
+  }
+
+  static void InsertIterSizeValue() {
+    // testing insert(iter, size, value)
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.begin();
+    iterator it1_next = it1;
+    ++it1_next;
+    Container C2 = C1;
+    const value_type value = makeValueType(3);
+    EXPECT_DEATH( C2.insert(it1, 1, value) ); // wrong container
+    C1.insert(it1_next, 2, value);
+    if  (CT == CT_List) {
+      C1.insert(it1_next, 3, value);
+      C1.insert(it1, 1, value);
+    } else {
+      EXPECT_DEATH( C1.insert(it1_next, 1, value) ); // invalidated iterator
+      EXPECT_DEATH( C1.insert(it1, 1, value) ); // invalidated iterator
+    }
+  }
+
+  static void InsertIterIterIter() {
+    // testing insert(iter, iter, iter)
+    Container C1 = makeContainer(2);
+    iterator it1 = C1.begin();
+    iterator it1_next = it1;
+    ++it1_next;
+    Container C2 = C1;
+    std::vector<value_type> V = {
+        makeValueType(1),
+        makeValueType(2),
+        makeValueType(3)
+    };
+    EXPECT_DEATH( C2.insert(it1, V.begin(), V.end()) ); // wrong container
+    C1.insert(it1_next, V.begin(), V.end());
+    if  (CT == CT_List) {
+      C1.insert(it1_next, V.begin(), V.end());
+      C1.insert(it1, V.begin(), V.end());
+    } else {
+      EXPECT_DEATH( C1.insert(it1_next, V.begin(), V.end()) ); // invalidated iterator
+      EXPECT_DEATH( C1.insert(it1, V.begin(), V.end()) ); // invalidated iterator
+    }
+  }
+};
+
+int main(int, char**)
+{
+  using Alloc = test_allocator<int>;
+  {
+    SequenceContainerChecks<std::list<int, Alloc>, CT_List>::run();
+    SequenceContainerChecks<std::vector<int, Alloc>, CT_Vector>::run();
+  }
+  // FIXME these containers don't support iterator debugging
+  if ((false)) {
+    SequenceContainerChecks<
+        std::vector<bool, test_allocator<bool>>, CT_VectorBool>::run();
+    SequenceContainerChecks<
+        std::forward_list<int, Alloc>, CT_ForwardList>::run();
+    SequenceContainerChecks<
+        std::deque<int, Alloc>, CT_Deque>::run();
+  }
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/debug/containers/string.pass.cpp b/libcxx/test/libcxx/debug/containers/string.pass.cpp
new file mode 100644 (file)
index 0000000..7206273
--- /dev/null
@@ -0,0 +1,94 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+// test container debugging
+
+#include <string>
+#include <vector>
+
+#include "test_macros.h"
+#include "check_assertion.h"
+#include "container_debug_tests.h"
+
+using namespace IteratorDebugChecks;
+
+typedef std::basic_string<char, std::char_traits<char>, test_allocator<char>>  StringType;
+
+template <class Container = StringType, ContainerType CT = CT_String>
+struct StringContainerChecks : BasicContainerChecks<Container, CT> {
+  using Base = BasicContainerChecks<Container, CT_String>;
+  using value_type = typename Container::value_type;
+  using allocator_type = typename Container::allocator_type;
+  using iterator = typename Container::iterator;
+  using const_iterator = typename Container::const_iterator;
+
+  using Base::makeContainer;
+  using Base::makeValueType;
+
+public:
+  static void run() {
+    Base::run_iterator_tests();
+    Base::run_allocator_aware_tests();
+
+    for (int N : {3, 128}) {
+      FrontOnEmptyContainer(N);
+      BackOnEmptyContainer(N);
+      PopBack(N);
+    }
+  }
+
+private:
+  static void BackOnEmptyContainer(int N) {
+    // testing back on empty
+    Container C = makeContainer(N);
+    Container const& CC = C;
+    iterator it = --C.end();
+    (void)C.back();
+    (void)CC.back();
+    C.pop_back();
+    EXPECT_DEATH( C.erase(it) );
+    C.clear();
+    EXPECT_DEATH( C.back() );
+    EXPECT_DEATH( CC.back() );
+  }
+
+  static void FrontOnEmptyContainer(int N) {
+    // testing front on empty
+    Container C = makeContainer(N);
+    Container const& CC = C;
+    (void)C.front();
+    (void)CC.front();
+    C.clear();
+    EXPECT_DEATH( C.front() );
+    EXPECT_DEATH( CC.front() );
+  }
+
+  static void PopBack(int N) {
+    // testing pop_back() invalidation
+    Container C1 = makeContainer(N);
+    iterator it1 = C1.end();
+    --it1;
+    C1.pop_back();
+    EXPECT_DEATH( C1.erase(it1) );
+    C1.erase(C1.begin(), C1.end());
+    assert(C1.size() == 0);
+    EXPECT_DEATH_MATCHES(DebugInfoMatcher("string::pop_back(): string is already empty"), C1.pop_back() );
+  }
+};
+
+int main(int, char**)
+{
+  StringContainerChecks<>::run();
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp b/libcxx/test/libcxx/debug/containers/unord_containers.pass.cpp
new file mode 100644 (file)
index 0000000..9831c84
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++11, c++14
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+// test container debugging
+
+#include <unordered_map>
+#include <unordered_set>
+#include <utility>
+#include <cassert>
+#include "check_assertion.h"
+#include "container_debug_tests.h"
+#include "test_macros.h"
+
+using namespace IteratorDebugChecks;
+
+template <class Container, ContainerType CT>
+struct UnorderedContainerChecks : BasicContainerChecks<Container, CT> {
+  using Base = BasicContainerChecks<Container, CT>;
+  using value_type = typename Container::value_type;
+  using iterator = typename Container::iterator;
+  using const_iterator = typename Container::const_iterator;
+  using traits = std::iterator_traits<iterator>;
+  using category = typename traits::iterator_category;
+
+  using Base::makeContainer;
+public:
+  static void run() {
+    Base::run();
+  }
+private:
+
+};
+
+int main(int, char**)
+{
+  using SetAlloc = test_allocator<int>;
+  using MapAlloc = test_allocator<std::pair<const int, int>>;
+  {
+    UnorderedContainerChecks<
+        std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
+        CT_UnorderedMap>::run();
+    UnorderedContainerChecks<
+        std::unordered_set<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
+        CT_UnorderedSet>::run();
+    UnorderedContainerChecks<
+        std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>, MapAlloc>,
+        CT_UnorderedMultiMap>::run();
+    UnorderedContainerChecks<
+        std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, SetAlloc>,
+        CT_UnorderedMultiSet>::run();
+  }
+
+  return 0;
+}
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 (file)
index bd04b06..0000000
+++ /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;
-}
index a74fdb01adf309c9cd7e7c0b104de2c853636977..f8223436d02563272e80ff3fce45329d01f7161c 100644 (file)
@@ -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_helper_test.pass.cpp b/libcxx/test/libcxx/debug/debug_helper_test.pass.cpp
deleted file mode 100644 (file)
index 3e86257..0000000
+++ /dev/null
@@ -1,67 +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
-
-#include <__debug>
-#include "debug_mode_helper.h"
-
-#include <cstdio>
-#include "test_macros.h"
-
-
-template <class Func>
-inline bool TestDeathTest(const char* stmt, Func&& func, DeathTest::ResultKind ExpectResult, DebugInfoMatcher Matcher = AnyMatcher) {
-  DeathTest DT(Matcher);
-  DeathTest::ResultKind RK = DT.Run(func);
-  auto OnFailure = [&](std::string msg) {
-    std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg.c_str());
-    if (!DT.getChildStdErr().empty()) {
-      std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str());
-    }
-    if (!DT.getChildStdOut().empty()) {
-      std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str());
-    }
-    return false;
-  };
-  if (RK != ExpectResult)
-    return OnFailure(std::string("expected result did not occur: expected ") + DeathTest::ResultKindToString(ExpectResult) + " got: " + DeathTest::ResultKindToString(RK));
-  return true;
-}
-#define TEST_DEATH_TEST(RK, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, AnyMatcher )))
-
-#define TEST_DEATH_TEST_MATCHES(RK, Matcher, ...) assert((TestDeathTest(#__VA_ARGS__, [&]() { __VA_ARGS__; }, RK, Matcher)))
-
-void my_libcpp_assert() {
-  _LIBCPP_ASSERT(false, "other");
-}
-
-void test_no_match_found() {
-  DebugInfoMatcher ExpectMatch("my message");
-  TEST_DEATH_TEST_MATCHES(DeathTest::RK_MatchFailure, ExpectMatch, my_libcpp_assert());
-}
-
-void test_did_not_die() {
-  TEST_DEATH_TEST(DeathTest::RK_DidNotDie, ((void)0));
-}
-
-void test_unknown() {
-  TEST_DEATH_TEST(DeathTest::RK_Unknown, std::exit(13));
-}
-
-int main(int, char**)
-{
-  test_no_match_found();
-  test_did_not_die();
-  test_unknown();
-  return 0;
-}
diff --git a/libcxx/test/libcxx/debug/debug_register.pass.cpp b/libcxx/test/libcxx/debug/debug_register.pass.cpp
deleted file mode 100644 (file)
index 9ed97ef..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-// UNSUPPORTED: libcxx-no-debug-mode
-
-#include <cstdlib>
-#include <string>
-#include <type_traits>
-#include <__debug>
-#include <cassert>
-
-#include "test_macros.h"
-
-void my_debug_function(std::__libcpp_debug_info const& info) {
-  assert(info.__msg_ == std::string("foo"));
-  std::exit(0);
-}
-
-int main(int, char**)
-{
-  std::__libcpp_set_debug_function(&my_debug_function);
-  _LIBCPP_ASSERT(false, "foo");
-  return 1;
-}
diff --git a/libcxx/test/libcxx/debug/register_debug_handler.pass.cpp b/libcxx/test/libcxx/debug/register_debug_handler.pass.cpp
new file mode 100644 (file)
index 0000000..9ed97ef
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+// UNSUPPORTED: libcxx-no-debug-mode
+
+#include <cstdlib>
+#include <string>
+#include <type_traits>
+#include <__debug>
+#include <cassert>
+
+#include "test_macros.h"
+
+void my_debug_function(std::__libcpp_debug_info const& info) {
+  assert(info.__msg_ == std::string("foo"));
+  std::exit(0);
+}
+
+int main(int, char**)
+{
+  std::__libcpp_set_debug_function(&my_debug_function);
+  _LIBCPP_ASSERT(false, "foo");
+  return 1;
+}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/assert.deallocate.pass.cpp
new file mode 100644 (file)
index 0000000..e73ddfc
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/memory_resource>
+
+// template <class T> class polymorphic_allocator
+
+// T* polymorphic_allocator<T>::deallocate(T*, size_t size)
+
+// 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"
+
+namespace ex = std::experimental::pmr;
+
+int main(int, char**) {
+    using Alloc = ex::polymorphic_allocator<int>;
+    using Traits = std::allocator_traits<Alloc>;
+    NullResource R;
+    Alloc a(&R);
+    const std::size_t maxSize = Traits::max_size(a);
+
+    a.deallocate(nullptr, maxSize); // no assertion
+    TEST_LIBCPP_ASSERT_FAILURE(a.deallocate(nullptr, maxSize + 1), "deallocate called for size which exceeds max_size()");
+
+    return 0;
+}
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/deallocate.assert.pass.cpp
deleted file mode 100644 (file)
index af6115c..0000000
+++ /dev/null
@@ -1,44 +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
-
-// <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
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
-    using Alloc = ex::polymorphic_allocator<int>;
-    using Traits = std::allocator_traits<Alloc>;
-    NullResource R;
-    Alloc a(&R);
-    const std::size_t maxSize = Traits::max_size(a);
-
-    a.deallocate(nullptr, maxSize); // no assertion
-    TEST_LIBCPP_ASSERT_FAILURE(a.deallocate(nullptr, maxSize + 1), "deallocate called for size which exceeds max_size()");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp b/libcxx/test/libcxx/experimental/memory/memory.resource.adaptor/memory.resource.adaptor.mem/assert.deallocate.pass.cpp
new file mode 100644 (file)
index 0000000..8867f34
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/memory_resource>
+
+// template <class T> class polymorphic_allocator
+
+// T* polymorphic_allocator<T>::deallocate(T*, size_t size)
+
+// 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"
+
+namespace ex = std::experimental::pmr;
+
+int main(int, char**) {
+    using Alloc = NullAllocator<char>;
+
+    AllocController P;
+    ex::resource_adaptor<Alloc> r(Alloc{P});
+    ex::memory_resource & m1 = r;
+
+    std::size_t maxSize = std::numeric_limits<std::size_t>::max()
+                            - alignof(std::max_align_t);
+
+    m1.deallocate(nullptr, maxSize); // no assertion
+    TEST_LIBCPP_ASSERT_FAILURE(m1.deallocate(nullptr, maxSize + 1), "do_deallocate called for size which exceeds the maximum allocation size");
+
+    return 0;
+}
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/deallocate.assert.pass.cpp
deleted file mode 100644 (file)
index 3665729..0000000
+++ /dev/null
@@ -1,47 +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
-
-// <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
-
-#include <experimental/memory_resource>
-#include <type_traits>
-#include <cassert>
-
-#include "test_memory_resource.h"
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-namespace ex = std::experimental::pmr;
-
-int main(int, char**)
-{
-    using Alloc = NullAllocator<char>;
-
-    AllocController P;
-    ex::resource_adaptor<Alloc> r(Alloc{P});
-    ex::memory_resource & m1 = r;
-
-    std::size_t maxSize = std::numeric_limits<std::size_t>::max()
-                            - alignof(std::max_align_t);
-
-    m1.deallocate(nullptr, maxSize); // no assertion
-    TEST_LIBCPP_ASSERT_FAILURE(m1.deallocate(nullptr, maxSize + 1), "do_deallocate called for size which exceeds the maximum allocation size");
-
-    return 0;
-}
diff --git a/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp b/libcxx/test/libcxx/input.output/filesystems/class.path/path.itr/assert.iterator.pass.cpp
new file mode 100644 (file)
index 0000000..0612c6b
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// <filesystem>
+
+// class path
+
+#include "filesystem_include.h"
+#include <iterator>
+#include <type_traits>
+#include <cassert>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+  // Test incrementing/decrementing a singular iterator
+  {
+    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 incrementing the end iterator
+  {
+    fs::path p("foo/bar");
+    auto it = p.begin();
+    TEST_LIBCPP_ASSERT_FAILURE(--it, "attempting to decrement the begin iterator");
+  }
+
+  // Test incrementing the end iterator
+  {
+    fs::path p("foo/bar");
+    auto it = p.end();
+    TEST_LIBCPP_ASSERT_FAILURE(++it, "attempting to increment the end iterator");
+  }
+
+  return 0;
+}
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/iterator_db.pass.cpp
deleted file mode 100644 (file)
index b29c0ca..0000000
+++ /dev/null
@@ -1,54 +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
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-
-// <filesystem>
-
-// class path
-
-#include "filesystem_include.h"
-#include <iterator>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-int main(int, char**) {
-  using namespace fs;
-  // Test incrementing/decrementing a singular iterator
-  {
-    path::iterator singular;
-    EXPECT_DEATH( ++singular );
-    EXPECT_DEATH( --singular );
-  }
-  // Test decrementing the begin iterator
-  {
-    path p("foo/bar");
-    auto it = p.begin();
-    ++it;
-    ++it;
-    EXPECT_DEATH( ++it );
-  }
-  // Test incrementing the end iterator
-  {
-    path p("foo/bar");
-    auto it = p.end();
-    EXPECT_DEATH( ++it );
-    --it;
-    --it;
-    EXPECT_DEATH( --it );
-  }
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/iterators/advance.debug1.pass.cpp b/libcxx/test/libcxx/iterators/advance.debug1.pass.cpp
deleted file mode 100644 (file)
index 09a4e6a..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// <list>
-
-// Call advance(non-bidi iterator, -1)
-
-#include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-#include "test_iterators.h"
-
-int main(int, char**)
-{
-    int a[] = {1, 2, 3};
-
-    bidirectional_iterator<int *> bidi(a+1);
-       std::advance(bidi,  1);  // should work fine
-       std::advance(bidi,  0);  // should work fine
-    std::advance(bidi, -1);  // should work fine
-
-    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
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/iterators/assert.advance.pass.cpp b/libcxx/test/libcxx/iterators/assert.advance.pass.cpp
new file mode 100644 (file)
index 0000000..f85dae8
--- /dev/null
@@ -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
+
+// <list>
+
+// Call advance(non-bidi iterator, -1)
+
+#include <iterator>
+
+#include "check_assertion.h"
+#include "test_iterators.h"
+
+int main(int, char**) {
+    int a[] = {1, 2, 3};
+
+    bidirectional_iterator<int *> bidi(a+1);
+       std::advance(bidi,  1);  // should work fine
+       std::advance(bidi,  0);  // should work fine
+    std::advance(bidi, -1);  // should work fine
+
+    forward_iterator<int *> it(a+1);
+       std::advance(it, 1);  // should work fine
+       std::advance(it, 0);  // should work fine
+    TEST_LIBCPP_ASSERT_FAILURE(std::advance(it, -1), "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/iterators/assert.next.pass.cpp b/libcxx/test/libcxx/iterators/assert.next.pass.cpp
new file mode 100644 (file)
index 0000000..0771539
--- /dev/null
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <list>
+
+// Call next(non-bidi iterator, -1)
+
+#include <iterator>
+
+#include "check_assertion.h"
+#include "test_iterators.h"
+
+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
+    TEST_LIBCPP_ASSERT_FAILURE(std::next(it, -1), "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/iterators/assert.prev.pass.cpp b/libcxx/test/libcxx/iterators/assert.prev.pass.cpp
new file mode 100644 (file)
index 0000000..3b92bce
--- /dev/null
@@ -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
+
+// <list>
+
+// Call prev(forward_iterator, -1)
+
+#include <iterator>
+
+#include "check_assertion.h"
+#include "test_iterators.h"
+
+int main(int, char**) {
+    int a[] = {1, 2, 3};
+
+    bidirectional_iterator<int *> bidi(a+1);
+    std::prev(bidi, -1);  // should work fine
+    std::prev(bidi,  0);  // should work fine
+    std::prev(bidi,  1);  // should work fine
+
+    forward_iterator<int *> it(a+1);
+    std::prev(it, -1); // should work fine
+    std::prev(it,  0); // should work fine
+    TEST_LIBCPP_ASSERT_FAILURE(std::prev(it, 1), "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/iterators/next.debug1.pass.cpp b/libcxx/test/libcxx/iterators/next.debug1.pass.cpp
deleted file mode 100644 (file)
index a7a51f7..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// <list>
-
-// Call next(non-bidi iterator, -1)
-
-#include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-#include "test_iterators.h"
-
-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
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/iterators/prev.debug1.pass.cpp b/libcxx/test/libcxx/iterators/prev.debug1.pass.cpp
deleted file mode 100644 (file)
index f236cdc..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03
-// UNSUPPORTED: windows
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// <list>
-
-// Call prev(forward_iterator, -1)
-
-#include <iterator>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-#include "test_iterators.h"
-
-int main(int, char**)
-{
-    int a[] = {1, 2, 3};
-
-    bidirectional_iterator<int *> bidi(a+1);
-    std::prev(bidi, -1);  // should work fine
-    std::prev(bidi,  0);  // should work fine
-    std::prev(bidi,  1);  // should work fine
-
-    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
-
-  return 0;
-}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.back.pass.cpp
new file mode 100644 (file)
index 0000000..d1a8cf5
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call back() on empty container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        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/assert.cback.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cback.pass.cpp
new file mode 100644 (file)
index 0000000..14e3622
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call back() on empty const container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+    {
+        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/assert.cfront.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cfront.pass.cpp
new file mode 100644 (file)
index 0000000..22aacd3
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Call front() on empty const container.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    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/assert.cindex.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.cindex.pass.cpp
new file mode 100644 (file)
index 0000000..b238fcd
--- /dev/null
@@ -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>
+
+// Index const string out of bounds.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+#include <cassert>
+
+#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::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/assert.front.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.front.pass.cpp
new file mode 100644 (file)
index 0000000..c0b4efb
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.h"
+
+int main(int, char**) {
+  {
+    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/assert.index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/assert.index.pass.cpp
new file mode 100644 (file)
index 0000000..33bca86
--- /dev/null
@@ -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>
+
+// Index string out of bounds.
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+#include <cassert>
+
+#include "check_assertion.h"
+#include "min_allocator.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");
+  }
+
+  {
+    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 (file)
index 640a763..0000000
+++ /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 (file)
index b6c33b0..0000000
+++ /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 (file)
index ab9e196..0000000
+++ /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_back_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_back_2.pass.cpp
deleted file mode 100644 (file)
index bb47d48..0000000
+++ /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 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"
-#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;
-}
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 (file)
index ce6181b..0000000
+++ /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_cback_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cback_2.pass.cpp
deleted file mode 100644 (file)
index eb5f22b..0000000
+++ /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 back() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "debug_macros.h"
-#include "test_macros.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;
-}
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 (file)
index 8eed44c..0000000
+++ /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_cfront_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cfront_2.pass.cpp
deleted file mode 100644 (file)
index cb8ca79..0000000
+++ /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 front() on empty const container.
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-#include <string>
-
-#include "debug_macros.h"
-#include "test_macros.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");
-
-  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 (file)
index 3f572af..0000000
+++ /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_cindex_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_cindex_2.pass.cpp
deleted file mode 100644 (file)
index 738aac1..0000000
+++ /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 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"
-#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");
-
-  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 (file)
index 0841d2f..0000000
+++ /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_front_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_front_2.pass.cpp
deleted file mode 100644 (file)
index 5b377e5..0000000
+++ /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 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"
-#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");
-
-  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 (file)
index c2a6d05..0000000
+++ /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/db_index_2.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.access/db_index_2.pass.cpp
deleted file mode 100644 (file)
index dae765d..0000000
+++ /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 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"
-#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");
-
-  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 (file)
index f03e784..0000000
+++ /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 (file)
index 8f6e7d3..0000000
+++ /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 (file)
index cf5de95..0000000
+++ /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 (file)
index 691e0e1..0000000
+++ /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 (file)
index e70ad42..0000000
+++ /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 different 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_11.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_11.pass.cpp
deleted file mode 100644 (file)
index 28aa671..0000000
+++ /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>
-
-// 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"
-#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");
-
-  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 (file)
index f35d29a..0000000
+++ /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_13.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_13.pass.cpp
deleted file mode 100644 (file)
index 7603417..0000000
+++ /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>
-
-// 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"
-#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");
-
-  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 (file)
index 3458f8f..0000000
+++ /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 (file)
index 79977a7..0000000
+++ /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 (file)
index 1c98997..0000000
+++ /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 different 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 (file)
index 71a92dd..0000000
+++ /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 different 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 (file)
index 2e3fece..0000000
+++ /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 (file)
index 5194ed6..0000000
+++ /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 (file)
index df0a4fd..0000000
+++ /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 (file)
index 6567ec1..0000000
+++ /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 (file)
index a89474c..0000000
+++ /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/db_iterators_9.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/db_iterators_9.pass.cpp
deleted file mode 100644 (file)
index e1e6091..0000000
+++ /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>
-
-// Compare iterators from different 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 compare incomparable iterators");
-
-  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 (file)
index 0000000..72bbb6a
--- /dev/null
@@ -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/debug.iterator.compare.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.compare.pass.cpp
new file mode 100644 (file)
index 0000000..9c75527
--- /dev/null
@@ -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>
+
+// Compare iterators from different containers with <.
+
+// 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 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/debug.iterator.decrement.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.decrement.pass.cpp
new file mode 100644 (file)
index 0000000..188367f
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Decrement iterator prior to begin.
+
+// 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.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/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.dereference.pass.cpp
new file mode 100644 (file)
index 0000000..fdedbb6
--- /dev/null
@@ -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>
+
+// Dereference non-dereferenceable iterator.
+
+// 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 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 iterator");
+  }
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.increment.pass.cpp
new file mode 100644 (file)
index 0000000..bf4eff7
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// Increment iterator past end.
+
+// 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;
+    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 iterator");
+  }
+
+  return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.iterators/debug.iterator.index.pass.cpp
new file mode 100644 (file)
index 0000000..742b4c9
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, 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();
+    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 (file)
index 0000000..d967071
--- /dev/null
@@ -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 different 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/assert.erase_iter.null.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.erase_iter.null.pass.cpp
new file mode 100644 (file)
index 0000000..e91f8d6
--- /dev/null
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+
+#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");
+  }
+
+  {
+    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;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/assert.pop_back.pass.cpp
new file mode 100644 (file)
index 0000000..8bec8fb
--- /dev/null
@@ -0,0 +1,25 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// void pop_back();
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    std::string s;
+    TEST_LIBCPP_ASSERT_FAILURE(s.pop_back(), "string::pop_back(): string is already empty");
+
+    return 0;
+}
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 (file)
index 0000000..739a94c
--- /dev/null
@@ -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 (file)
index 0000000..2d55d60
--- /dev/null
@@ -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/debug.insert.iter_char.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_char.pass.cpp
new file mode 100644 (file)
index 0000000..a1463bf
--- /dev/null
@@ -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
+//
+//===----------------------------------------------------------------------===//
+
+// <string>
+
+// iterator insert(const_iterator p, charT c);
+
+// 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
+//       actually work if the dylib hasn't been built with debug assertions enabled.
+//       Until we overhaul the debug mode, mark this test as unsupported to avoid
+//       spurious CI failures.
+// REQUIRES: never-run
+
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    typedef std::string S;
+    S s;
+    S s2;
+    TEST_LIBCPP_ASSERT_FAILURE(s.insert(s2.begin(), '1'),
+        "string::insert(iterator, character) called with an iterator not referring to this string");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_iter_iter.pass.cpp
new file mode 100644 (file)
index 0000000..3eeb1a3
--- /dev/null
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// template<class InputIterator>
+//   iterator insert(const_iterator p, InputIterator first, InputIterator last);
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    std::string v;
+    std::string v2;
+    char a[] = "123";
+    const int N = sizeof(a)/sizeof(a[0]);
+    TEST_LIBCPP_ASSERT_FAILURE(v.insert(v2.cbegin() + 10, a, a + N),
+                               "Attempted to add/subtract an iterator outside its valid range");
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/debug.insert.iter_size_char.pass.cpp
new file mode 100644 (file)
index 0000000..55a44ba
--- /dev/null
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+// 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>
+
+// iterator insert(const_iterator p, size_type n, charT c);
+
+// UNSUPPORTED: libcxx-no-debug-mode, c++03, windows
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
+
+#include <string>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    std::string s;
+    std::string s2;
+    TEST_LIBCPP_ASSERT_FAILURE(
+        s.insert(s2.begin(), 1, 'a'),
+        "string::insert(iterator, n, value) called with an iterator not referring to this string");
+
+    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/erase_iter_db1.pass.cpp
deleted file mode 100644 (file)
index b1a3f01..0000000
+++ /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 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"
-
-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;
-}
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 (file)
index 2a67423..0000000
+++ /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 (file)
index d6099bb..0000000
+++ /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 (file)
index 2c22912..0000000
+++ /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 (file)
index c5fe4f8..0000000
+++ /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 (file)
index 657c3b6..0000000
+++ /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 (file)
index ae1d038..0000000
+++ /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 (file)
index 0c9f2d1..0000000
+++ /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 (file)
index c4ac4fe..0000000
+++ /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 (file)
index b2b5099..0000000
+++ /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 (file)
index d51985c..0000000
+++ /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 (file)
index 6b5e49f..0000000
+++ /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/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.modifiers/erase_pop_back_db1.pass.cpp
deleted file mode 100644 (file)
index fecd29f..0000000
+++ /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>
-
-// void pop_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.pop_back(), "string::pop_back(): string is already empty");
-
-    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/insert_iter_char_db1.pass.cpp
deleted file mode 100644 (file)
index ac05b69..0000000
+++ /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
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-
-// iterator insert(const_iterator p, charT c);
-
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=1
-
-// TODO: Since string::insert(iter, char) is intantiated in the dylib, this test doesn't
-//       actually work if the dylib hasn't been built with debug assertions enabled.
-//       Until we overhaul the debug mode, mark this test as unsupported to avoid
-//       spurious CI failures.
-// REQUIRES: never-run
-
-#include <string>
-
-#include "test_macros.h"
-#include "debug_macros.h"
-
-int main(int, char**)
-{
-    typedef std::string S;
-    S s;
-    S s2;
-    TEST_LIBCPP_ASSERT_FAILURE(s.insert(s2.begin(), '1'),
-        "string::insert(iterator, character) called with an iterator not referring to this string");
-
-    return 0;
-}
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/insert_iter_iter_iter_db1.pass.cpp
deleted file mode 100644 (file)
index 08ab646..0000000
+++ /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>
-
-// template<class InputIterator>
-//   iterator insert(const_iterator p, InputIterator first, InputIterator last);
-
-// 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 v;
-    std::string v2;
-    char a[] = "123";
-    const int N = sizeof(a)/sizeof(a[0]);
-    TEST_LIBCPP_ASSERT_FAILURE(v.insert(v2.cbegin() + 10, a, a + N),
-                               "Attempted to add/subtract an iterator outside its valid range");
-
-    return 0;
-}
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/insert_iter_size_char_db1.pass.cpp
deleted file mode 100644 (file)
index 1e74412..0000000
+++ /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>
-
-// iterator insert(const_iterator p, size_type n, charT c);
-
-// 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;
-    std::string s2;
-    TEST_LIBCPP_ASSERT_FAILURE(
-        s.insert(s2.begin(), 1, 'a'),
-        "string::insert(iterator, n, value) called with an iterator not referring to this string");
-
-    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 (file)
index 0000000..c3b8e68
--- /dev/null
@@ -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/assert.set_exception.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception.pass.cpp
new file mode 100644 (file)
index 0000000..a3f327b
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcpp-has-no-threads
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// <future>
+
+// class promise<R>
+
+// void set_exception(exception_ptr p);
+// Test that a null exception_ptr is diagnosed.
+
+#include <future>
+#include <exception>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        std::promise<T> p;
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception(std::exception_ptr()), "promise::set_exception: received nullptr");
+    }
+
+    {
+        typedef int& T;
+        std::promise<T> p;
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception(std::exception_ptr()), "promise::set_exception: received nullptr");
+    }
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/assert.set_exception_at_thread_exit.pass.cpp
new file mode 100644 (file)
index 0000000..911fff3
--- /dev/null
@@ -0,0 +1,40 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: libcpp-has-no-threads
+
+// UNSUPPORTED: c++03, windows, libcxx-no-debug-mode
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DEBUG=0
+
+// <future>
+
+// class promise<R>
+
+// void set_exception_on_thread_exit(exception_ptr p);
+// Test that a null exception_ptr is diagnosed.
+
+#include <future>
+#include <exception>
+
+#include "check_assertion.h"
+
+int main(int, char**) {
+    {
+        typedef int T;
+        std::promise<T> p;
+        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;
+        TEST_LIBCPP_ASSERT_FAILURE(p.set_exception_at_thread_exit(std::exception_ptr()), "promise::set_exception_at_thread_exit: received nullptr");
+    }
+
+    return 0;
+}
diff --git a/libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/libcxx/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
deleted file mode 100644 (file)
index 150813d..0000000
+++ /dev/null
@@ -1,47 +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: windows
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-
-// <future>
-
-// class promise<R>
-
-// void set_exception(exception_ptr p);
-// Test that a null exception_ptr is diagnosed.
-
-#include <future>
-#include <exception>
-#include <cstdlib>
-#include <cassert>
-
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-int main(int, char**)
-{
-    {
-        typedef int T;
-        std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception(std::exception_ptr()) );
-    }
-    {
-        typedef int& T;
-        std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception(std::exception_ptr()) );
-    }
-
-  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/set_exception_at_thread_exit.pass.cpp
deleted file mode 100644 (file)
index 19b6756..0000000
+++ /dev/null
@@ -1,48 +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: windows
-// UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++03
-// UNSUPPORTED: libcxx-no-debug-mode
-
-// ADDITIONAL_COMPILE_FLAGS: -Wno-macro-redefined -D_LIBCPP_DEBUG=0
-
-// <future>
-
-// class promise<R>
-
-// void set_exception_on_thread_exit(exception_ptr p);
-// Test that a null exception_ptr is diagnosed.
-
-#include <future>
-#include <exception>
-#include <cstdlib>
-#include <cassert>
-#include "test_macros.h"
-#include "debug_mode_helper.h"
-
-
-int main(int, char**)
-{
-    {
-        typedef int T;
-        std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception_at_thread_exit(std::exception_ptr()) );
-
-    }
-    {
-        typedef int& T;
-        std::promise<T> p;
-
-        EXPECT_DEATH( p.set_exception_at_thread_exit(std::exception_ptr()) );
-    }
-
-  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 (file)
index 0000000..c389389
--- /dev/null
@@ -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 (file)
index 0000000..fde804e
--- /dev/null
@@ -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 (file)
index 4fd04dd..0000000
+++ /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 (file)
index 1f660fc..0000000
+++ /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 (file)
index 551e548..0000000
+++ /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 (file)
index 6df3c6c..0000000
+++ /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 (file)
index a4db009..0000000
+++ /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 (file)
index 0bf2d44..0000000
+++ /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/check_assertion.h b/libcxx/test/support/check_assertion.h
new file mode 100644 (file)
index 0000000..eb1324e
--- /dev/null
@@ -0,0 +1,299 @@
+//===----------------------------------------------------------------------===//
+//
+// 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_CHECK_ASSERTION_H
+#define TEST_SUPPORT_CHECK_ASSERTION_H
+
+#ifndef _LIBCPP_DEBUG
+#error _LIBCPP_DEBUG must be defined before including this header
+#endif
+
+#include <ciso646>
+#ifndef _LIBCPP_VERSION
+#error "This header may only be used for libc++ tests"
+#endif
+
+#include <__debug>
+#include <cassert>
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <string>
+#include <string_view>
+#include <utility>
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include "test_macros.h"
+#include "test_allocator.h"
+
+#if TEST_STD_VER < 11
+# error "C++11 or greater is required to use this header"
+#endif
+
+struct DebugInfoMatcher {
+  static const int any_line = -1;
+  static constexpr const char* any_file = "*";
+  static constexpr const char* any_msg = "*";
+
+  constexpr DebugInfoMatcher() : is_empty(true), msg(any_msg, __builtin_strlen(any_msg)), file(any_file, __builtin_strlen(any_file)), line(any_line) { }
+  constexpr DebugInfoMatcher(const char* msg_, const char* file_ = any_file, int line_ = any_line)
+    : is_empty(false), msg(msg_, __builtin_strlen(msg_)), file(file_, __builtin_strlen(file_)), line(line_) {}
+
+  bool Matches(std::__libcpp_debug_info const& got) const {
+    assert(!empty() && "empty matcher");
+
+    if (CheckLineMatches(got.__line_) && CheckFileMatches(got.__file_) &&
+        CheckMessageMatches(got.__msg_))
+        return true;
+    // Write to stdout because that's the file descriptor captured by the parent
+    // process.
+    std::printf("Failed to match debug info!\n%s\nVS\n%s\n", ToString().data(), got.what().data());
+    return false;
+  }
+
+  std::string ToString() const {
+    std::string result = "msg = \""; result += msg; result += "\"\n";
+    result += "line = " + (line == any_line ? "'*'" : std::to_string(line)) + "\n";
+    result += "file = " + (file == any_file ? "'*'" : std::string(any_file));
+    return result;
+  }
+
+  bool empty() const { return is_empty; }
+private:
+  bool CheckLineMatches(int got_line) const {
+    if (line == any_line)
+      return true;
+    return got_line == line;
+  }
+
+  bool CheckFileMatches(std::string_view got_file) const {
+    assert(!empty() && "empty matcher");
+    if (file == any_file)
+      return true;
+    std::size_t found_at = got_file.find(file);
+    if (found_at == std::string_view::npos)
+      return false;
+    // require the match start at the beginning of the file or immediately after
+    // a directory separator.
+    if (found_at != 0) {
+      char last_char = got_file[found_at - 1];
+      if (last_char != '/' && last_char != '\\')
+        return false;
+    }
+    // require the match goes until the end of the string.
+    return got_file.substr(found_at) == file;
+  }
+
+  bool CheckMessageMatches(std::string_view got_msg) const {
+    assert(!empty() && "empty matcher");
+    if (msg == any_msg)
+      return true;
+    std::size_t found_at = got_msg.find(msg);
+    if (found_at == std::string_view::npos)
+      return false;
+    // Allow any match
+    return true;
+  }
+private:
+  bool is_empty;
+  std::string_view msg;
+  std::string_view file;
+  int line;
+};
+
+static constexpr DebugInfoMatcher AnyMatcher(DebugInfoMatcher::any_msg);
+
+inline DebugInfoMatcher& GlobalMatcher() {
+  static DebugInfoMatcher GMatch;
+  return GMatch;
+}
+
+struct DeathTest {
+  enum ResultKind {
+    RK_DidNotDie, RK_MatchFound, RK_MatchFailure, RK_SetupFailure, RK_Unknown
+  };
+
+  static const char* ResultKindToString(ResultKind RK) {
+#define CASE(K) case K: return #K
+    switch (RK) {
+    CASE(RK_MatchFailure);
+    CASE(RK_DidNotDie);
+    CASE(RK_SetupFailure);
+    CASE(RK_MatchFound);
+    CASE(RK_Unknown);
+    }
+    return "not a result kind";
+  }
+
+  static bool IsValidResultKind(int val) {
+    return val >= RK_DidNotDie && val <= RK_Unknown;
+  }
+
+  TEST_NORETURN static void DeathTestDebugHandler(std::__libcpp_debug_info const& info) {
+    assert(!GlobalMatcher().empty());
+    if (GlobalMatcher().Matches(info)) {
+      std::exit(RK_MatchFound);
+    }
+    std::exit(RK_MatchFailure);
+  }
+
+
+  DeathTest(DebugInfoMatcher const& Matcher) : matcher_(Matcher) {}
+
+  template <class Func>
+  ResultKind Run(Func&& f) {
+    int pipe_res = pipe(stdout_pipe_fd_);
+    assert(pipe_res != -1 && "failed to create pipe");
+    pipe_res = pipe(stderr_pipe_fd_);
+    assert(pipe_res != -1 && "failed to create pipe");
+    pid_t child_pid = fork();
+    assert(child_pid != -1 &&
+        "failed to fork a process to perform a death test");
+    child_pid_ = child_pid;
+    if (child_pid_ == 0) {
+      RunForChild(std::forward<Func>(f));
+      assert(false && "unreachable");
+    }
+    return RunForParent();
+  }
+
+  int getChildExitCode() const { return exit_code_; }
+  std::string const& getChildStdOut() const { return stdout_from_child_; }
+  std::string const& getChildStdErr() const { return stderr_from_child_; }
+private:
+  template <class Func>
+  TEST_NORETURN void RunForChild(Func&& f) {
+    close(GetStdOutReadFD()); // don't need to read from the pipe in the child.
+    close(GetStdErrReadFD());
+    auto DupFD = [](int DestFD, int TargetFD) {
+      int dup_result = dup2(DestFD, TargetFD);
+      if (dup_result == -1)
+        std::exit(RK_SetupFailure);
+    };
+    DupFD(GetStdOutWriteFD(), STDOUT_FILENO);
+    DupFD(GetStdErrWriteFD(), STDERR_FILENO);
+
+    GlobalMatcher() = matcher_;
+    std::__libcpp_set_debug_function(&DeathTestDebugHandler);
+    f();
+    std::exit(RK_DidNotDie);
+  }
+
+  static std::string ReadChildIOUntilEnd(int FD) {
+    std::string error_msg;
+    char buffer[256];
+    int num_read;
+    do {
+      while ((num_read = read(FD, buffer, 255)) > 0) {
+        buffer[num_read] = '\0';
+        error_msg += buffer;
+      }
+    } while (num_read == -1 && errno == EINTR);
+    return error_msg;
+  }
+
+  void CaptureIOFromChild() {
+    close(GetStdOutWriteFD()); // no need to write from the parent process
+    close(GetStdErrWriteFD());
+    stdout_from_child_ = ReadChildIOUntilEnd(GetStdOutReadFD());
+    stderr_from_child_ = ReadChildIOUntilEnd(GetStdErrReadFD());
+    close(GetStdOutReadFD());
+    close(GetStdErrReadFD());
+  }
+
+  ResultKind RunForParent() {
+    CaptureIOFromChild();
+
+    int status_value;
+    pid_t result = waitpid(child_pid_, &status_value, 0);
+    assert(result != -1 && "there is no child process to wait for");
+
+    if (WIFEXITED(status_value)) {
+      exit_code_ = WEXITSTATUS(status_value);
+      if (!IsValidResultKind(exit_code_))
+        return RK_Unknown;
+      return static_cast<ResultKind>(exit_code_);
+    }
+    return RK_Unknown;
+  }
+
+  DeathTest(DeathTest const&) = delete;
+  DeathTest& operator=(DeathTest const&) = delete;
+
+  int GetStdOutReadFD() const {
+    return stdout_pipe_fd_[0];
+  }
+
+  int GetStdOutWriteFD() const {
+    return stdout_pipe_fd_[1];
+  }
+
+  int GetStdErrReadFD() const {
+    return stderr_pipe_fd_[0];
+  }
+
+  int GetStdErrWriteFD() const {
+    return stderr_pipe_fd_[1];
+  }
+private:
+  DebugInfoMatcher matcher_;
+  pid_t child_pid_ = -1;
+  int exit_code_ = -1;
+  int stdout_pipe_fd_[2];
+  int stderr_pipe_fd_[2];
+  std::string stdout_from_child_;
+  std::string stderr_from_child_;
+};
+
+template <class Func>
+inline bool ExpectDeath(const char* stmt, Func&& func, DebugInfoMatcher Matcher) {
+  DeathTest DT(Matcher);
+  DeathTest::ResultKind RK = DT.Run(func);
+  auto OnFailure = [&](const char* msg) {
+    std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg);
+    if (RK != DeathTest::RK_Unknown) {
+      std::fprintf(stderr, "child exit code: %d\n", DT.getChildExitCode());
+    }
+    if (!DT.getChildStdErr().empty()) {
+      std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str());
+    }
+    if (!DT.getChildStdOut().empty()) {
+      std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str());
+    }
+    return false;
+  };
+  switch (RK) {
+  case DeathTest::RK_MatchFound:
+    return true;
+  case DeathTest::RK_SetupFailure:
+    return OnFailure("child failed to setup test environment");
+  case DeathTest::RK_Unknown:
+      return OnFailure("reason unknown");
+  case DeathTest::RK_DidNotDie:
+      return OnFailure("child did not die");
+  case DeathTest::RK_MatchFailure:
+      return OnFailure("matcher failed");
+  }
+  assert(false && "unreachable");
+}
+
+template <class Func>
+inline bool ExpectDeath(const char* stmt, Func&& func) {
+  return ExpectDeath(stmt, func, AnyMatcher);
+}
+
+/// Assert that the specified expression throws a libc++ debug exception.
+#define EXPECT_DEATH(...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; } )))
+
+#define EXPECT_DEATH_MATCHES(Matcher, ...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; }, Matcher)))
+
+#define TEST_LIBCPP_ASSERT_FAILURE(expr, message) assert((ExpectDeath(#expr, [&]() { (void)(expr); }, DebugInfoMatcher(message))))
+
+#endif // TEST_SUPPORT_CHECK_ASSERTION_H
index 203357aa43362f2f4ffdc93dc3441036b86c6b1c..fc0d60f86d0f281ae542571bf353186569dc9ca7 100644 (file)
@@ -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 (file)
index bb1c40b..0000000
+++ /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/test/support/debug_mode_helper.h b/libcxx/test/support/debug_mode_helper.h
deleted file mode 100644 (file)
index fdda3d7..0000000
+++ /dev/null
@@ -1,297 +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_MODE_HELPER_H
-#define TEST_SUPPORT_DEBUG_MODE_HELPER_H
-
-#ifndef _LIBCPP_DEBUG
-#error _LIBCPP_DEBUG must be defined before including this header
-#endif
-
-#include <ciso646>
-#ifndef _LIBCPP_VERSION
-#error "This header may only be used for libc++ tests"
-#endif
-
-#include <__debug>
-#include <cassert>
-#include <cstddef>
-#include <cstdio>
-#include <cstdlib>
-#include <string>
-#include <string_view>
-#include <utility>
-
-#include <unistd.h>
-#include <errno.h>
-#include <sys/wait.h>
-#include "test_macros.h"
-#include "test_allocator.h"
-
-#if TEST_STD_VER < 11
-# error "C++11 or greater is required to use this header"
-#endif
-
-struct DebugInfoMatcher {
-  static const int any_line = -1;
-  static constexpr const char* any_file = "*";
-  static constexpr const char* any_msg = "*";
-
-  constexpr DebugInfoMatcher() : is_empty(true), msg(any_msg, __builtin_strlen(any_msg)), file(any_file, __builtin_strlen(any_file)), line(any_line) { }
-  constexpr DebugInfoMatcher(const char* msg_, const char* file_ = any_file, int line_ = any_line)
-    : is_empty(false), msg(msg_, __builtin_strlen(msg_)), file(file_, __builtin_strlen(file_)), line(line_) {}
-
-  bool Matches(std::__libcpp_debug_info const& got) const {
-    assert(!empty() && "empty matcher");
-
-    if (CheckLineMatches(got.__line_) && CheckFileMatches(got.__file_) &&
-        CheckMessageMatches(got.__msg_))
-        return true;
-    // Write to stdout because that's the file descriptor captured by the parent
-    // process.
-    std::printf("Failed to match debug info!\n%s\nVS\n%s\n", ToString().data(), got.what().data());
-    return false;
-  }
-
-  std::string ToString() const {
-    std::string result = "msg = \""; result += msg; result += "\"\n";
-    result += "line = " + (line == any_line ? "'*'" : std::to_string(line)) + "\n";
-    result += "file = " + (file == any_file ? "'*'" : std::string(any_file));
-    return result;
-  }
-
-  bool empty() const { return is_empty; }
-private:
-  bool CheckLineMatches(int got_line) const {
-    if (line == any_line)
-      return true;
-    return got_line == line;
-  }
-
-  bool CheckFileMatches(std::string_view got_file) const {
-    assert(!empty() && "empty matcher");
-    if (file == any_file)
-      return true;
-    std::size_t found_at = got_file.find(file);
-    if (found_at == std::string_view::npos)
-      return false;
-    // require the match start at the beginning of the file or immediately after
-    // a directory separator.
-    if (found_at != 0) {
-      char last_char = got_file[found_at - 1];
-      if (last_char != '/' && last_char != '\\')
-        return false;
-    }
-    // require the match goes until the end of the string.
-    return got_file.substr(found_at) == file;
-  }
-
-  bool CheckMessageMatches(std::string_view got_msg) const {
-    assert(!empty() && "empty matcher");
-    if (msg == any_msg)
-      return true;
-    std::size_t found_at = got_msg.find(msg);
-    if (found_at == std::string_view::npos)
-      return false;
-    // Allow any match
-    return true;
-  }
-private:
-  bool is_empty;
-  std::string_view msg;
-  std::string_view file;
-  int line;
-};
-
-static constexpr DebugInfoMatcher AnyMatcher(DebugInfoMatcher::any_msg);
-
-inline DebugInfoMatcher& GlobalMatcher() {
-  static DebugInfoMatcher GMatch;
-  return GMatch;
-}
-
-struct DeathTest {
-  enum ResultKind {
-    RK_DidNotDie, RK_MatchFound, RK_MatchFailure, RK_SetupFailure, RK_Unknown
-  };
-
-  static const char* ResultKindToString(ResultKind RK) {
-#define CASE(K) case K: return #K
-    switch (RK) {
-    CASE(RK_MatchFailure);
-    CASE(RK_DidNotDie);
-    CASE(RK_SetupFailure);
-    CASE(RK_MatchFound);
-    CASE(RK_Unknown);
-    }
-    return "not a result kind";
-  }
-
-  static bool IsValidResultKind(int val) {
-    return val >= RK_DidNotDie && val <= RK_Unknown;
-  }
-
-  TEST_NORETURN static void DeathTestDebugHandler(std::__libcpp_debug_info const& info) {
-    assert(!GlobalMatcher().empty());
-    if (GlobalMatcher().Matches(info)) {
-      std::exit(RK_MatchFound);
-    }
-    std::exit(RK_MatchFailure);
-  }
-
-
-  DeathTest(DebugInfoMatcher const& Matcher) : matcher_(Matcher) {}
-
-  template <class Func>
-  ResultKind Run(Func&& f) {
-    int pipe_res = pipe(stdout_pipe_fd_);
-    assert(pipe_res != -1 && "failed to create pipe");
-    pipe_res = pipe(stderr_pipe_fd_);
-    assert(pipe_res != -1 && "failed to create pipe");
-    pid_t child_pid = fork();
-    assert(child_pid != -1 &&
-        "failed to fork a process to perform a death test");
-    child_pid_ = child_pid;
-    if (child_pid_ == 0) {
-      RunForChild(std::forward<Func>(f));
-      assert(false && "unreachable");
-    }
-    return RunForParent();
-  }
-
-  int getChildExitCode() const { return exit_code_; }
-  std::string const& getChildStdOut() const { return stdout_from_child_; }
-  std::string const& getChildStdErr() const { return stderr_from_child_; }
-private:
-  template <class Func>
-  TEST_NORETURN void RunForChild(Func&& f) {
-    close(GetStdOutReadFD()); // don't need to read from the pipe in the child.
-    close(GetStdErrReadFD());
-    auto DupFD = [](int DestFD, int TargetFD) {
-      int dup_result = dup2(DestFD, TargetFD);
-      if (dup_result == -1)
-        std::exit(RK_SetupFailure);
-    };
-    DupFD(GetStdOutWriteFD(), STDOUT_FILENO);
-    DupFD(GetStdErrWriteFD(), STDERR_FILENO);
-
-    GlobalMatcher() = matcher_;
-    std::__libcpp_set_debug_function(&DeathTestDebugHandler);
-    f();
-    std::exit(RK_DidNotDie);
-  }
-
-  static std::string ReadChildIOUntilEnd(int FD) {
-    std::string error_msg;
-    char buffer[256];
-    int num_read;
-    do {
-      while ((num_read = read(FD, buffer, 255)) > 0) {
-        buffer[num_read] = '\0';
-        error_msg += buffer;
-      }
-    } while (num_read == -1 && errno == EINTR);
-    return error_msg;
-  }
-
-  void CaptureIOFromChild() {
-    close(GetStdOutWriteFD()); // no need to write from the parent process
-    close(GetStdErrWriteFD());
-    stdout_from_child_ = ReadChildIOUntilEnd(GetStdOutReadFD());
-    stderr_from_child_ = ReadChildIOUntilEnd(GetStdErrReadFD());
-    close(GetStdOutReadFD());
-    close(GetStdErrReadFD());
-  }
-
-  ResultKind RunForParent() {
-    CaptureIOFromChild();
-
-    int status_value;
-    pid_t result = waitpid(child_pid_, &status_value, 0);
-    assert(result != -1 && "there is no child process to wait for");
-
-    if (WIFEXITED(status_value)) {
-      exit_code_ = WEXITSTATUS(status_value);
-      if (!IsValidResultKind(exit_code_))
-        return RK_Unknown;
-      return static_cast<ResultKind>(exit_code_);
-    }
-    return RK_Unknown;
-  }
-
-  DeathTest(DeathTest const&) = delete;
-  DeathTest& operator=(DeathTest const&) = delete;
-
-  int GetStdOutReadFD() const {
-    return stdout_pipe_fd_[0];
-  }
-
-  int GetStdOutWriteFD() const {
-    return stdout_pipe_fd_[1];
-  }
-
-  int GetStdErrReadFD() const {
-    return stderr_pipe_fd_[0];
-  }
-
-  int GetStdErrWriteFD() const {
-    return stderr_pipe_fd_[1];
-  }
-private:
-  DebugInfoMatcher matcher_;
-  pid_t child_pid_ = -1;
-  int exit_code_ = -1;
-  int stdout_pipe_fd_[2];
-  int stderr_pipe_fd_[2];
-  std::string stdout_from_child_;
-  std::string stderr_from_child_;
-};
-
-template <class Func>
-inline bool ExpectDeath(const char* stmt, Func&& func, DebugInfoMatcher Matcher) {
-  DeathTest DT(Matcher);
-  DeathTest::ResultKind RK = DT.Run(func);
-  auto OnFailure = [&](const char* msg) {
-    std::fprintf(stderr, "EXPECT_DEATH( %s ) failed! (%s)\n\n", stmt, msg);
-    if (RK != DeathTest::RK_Unknown) {
-      std::fprintf(stderr, "child exit code: %d\n", DT.getChildExitCode());
-    }
-    if (!DT.getChildStdErr().empty()) {
-      std::fprintf(stderr, "---------- standard err ----------\n%s\n", DT.getChildStdErr().c_str());
-    }
-    if (!DT.getChildStdOut().empty()) {
-      std::fprintf(stderr, "---------- standard out ----------\n%s\n", DT.getChildStdOut().c_str());
-    }
-    return false;
-  };
-  switch (RK) {
-  case DeathTest::RK_MatchFound:
-    return true;
-  case DeathTest::RK_SetupFailure:
-    return OnFailure("child failed to setup test environment");
-  case DeathTest::RK_Unknown:
-      return OnFailure("reason unknown");
-  case DeathTest::RK_DidNotDie:
-      return OnFailure("child did not die");
-  case DeathTest::RK_MatchFailure:
-      return OnFailure("matcher failed");
-  }
-  assert(false && "unreachable");
-}
-
-template <class Func>
-inline bool ExpectDeath(const char* stmt, Func&& func) {
-  return ExpectDeath(stmt, func, AnyMatcher);
-}
-
-/// Assert that the specified expression throws a libc++ debug exception.
-#define EXPECT_DEATH(...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; } )))
-
-#define EXPECT_DEATH_MATCHES(Matcher, ...) assert((ExpectDeath(#__VA_ARGS__, [&]() { __VA_ARGS__; }, Matcher)))
-
-#endif // TEST_SUPPORT_DEBUG_MODE_HELPER_H
index 81a7d84a111b1420ca6264007662193010db2c21..7be5c28b538299a877a87bc895ec67a2d9e6bdf8 100644 (file)
@@ -125,6 +125,7 @@ DEFAULT_PARAMETERS = [
             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
             ])),