From 1f5ca1a15c802a554be3ddbe29f7f48bead433e0 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 29 Aug 2010 17:39:00 +0000 Subject: [PATCH] [multiple changes] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2010-08-29 Paolo Carlini * testsuite/23_containers/bitset/invalidation: Move... * testsuite/23_containers/bitset/debug/invalidation: ... here. * testsuite/23_containers/deque/invalidation: Move... * testsuite/23_containers/deque/debug/invalidation: ... here. * testsuite/23_containers/list/invalidation: Move... * testsuite/23_containers/list/debug/invalidation: ... here. * testsuite/23_containers/map/invalidation: Move... * testsuite/23_containers/map/debug/invalidation: ... here. * testsuite/23_containers/multimap/invalidation: Move... * testsuite/23_containers/multimap/debug/invalidation: ... here. * testsuite/23_containers/set/invalidation: Move... * testsuite/23_containers/set/debug/invalidation: ... here. * testsuite/23_containers/multiset/invalidation: Move... * testsuite/23_containers/multiset/debug/invalidation: ... here. * testsuite/23_containers/vector/invalidation: Move... * testsuite/23_containers/vector/debug/invalidation: ... here. 2010-08-29 François Dumont * include/bits/stl_algobase.h (_Iter_base): Move... * include/bits/stl_iterator_base_types.h: ...here. * include/debug/functions.h (__check_valid_range, __check_string, __check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include formatter.h and use formatting macros for a consistent debug result. * include/debug/formatter.h (__check_singular): Declare; do not include debug.h. * include/debug/debug.h: Do not include formatter.h. * include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator) rename to iterator_type. (__gnu_debug::__base): Add. * include/debug/set.h: Use everywhere __gnu_debug::__base once iterator range valided. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * testsuite/23_containers/util/debug/assign_neg.h: New test cases on debug checks performed on container assign operation. * testsuite/23_containers/util/debug/construct_neg.h: New test cases on debug checks on constructors. * testsuite/23_containers/util/debug/insert_neg.h: New test cases on debug checks performed on container insert operations. * testsuite/23_containers/unordered_map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: New. * testsuite/23_containers/multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/map/debug/cont_traits.h, debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/vector/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/deque/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/23_containers/list/debug/cont_traits.h, debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, insert3_neg.cc, insert4_neg.cc: Likewise. * testsuite/performance/23_containers/range_construct/ list_construct1.cc: New, validate performance impact of the patch on the debug mode. * testsuite/performance/23_containers/range_construct/ list_construct2.cc: Likewise. * testsuite/performance/23_containers/range_construct/ vector_construct.cc: Likewise. * testsuite/performance/23_containers/range_construct/ deque_construct.cc: Likewise. From-SVN: r163628 --- libstdc++-v3/ChangeLog | 106 ++++++++++++++ libstdc++-v3/include/bits/stl_algobase.h | 21 --- .../include/bits/stl_iterator_base_types.h | 18 +++ libstdc++-v3/include/debug/debug.h | 1 - libstdc++-v3/include/debug/deque | 10 +- libstdc++-v3/include/debug/formatter.h | 4 +- libstdc++-v3/include/debug/functions.h | 11 +- libstdc++-v3/include/debug/list | 10 +- libstdc++-v3/include/debug/map.h | 7 +- libstdc++-v3/include/debug/multimap.h | 7 +- libstdc++-v3/include/debug/multiset.h | 17 ++- libstdc++-v3/include/debug/safe_iterator.h | 39 ++++- libstdc++-v3/include/debug/set.h | 7 +- libstdc++-v3/include/debug/string | 15 +- libstdc++-v3/include/debug/unordered_map | 18 ++- libstdc++-v3/include/debug/unordered_set | 18 ++- libstdc++-v3/include/debug/vector | 11 +- .../bitset/{ => debug}/invalidation/1.cc | 0 .../23_containers/deque/debug/assign1_neg.cc | 32 +++++ .../23_containers/deque/debug/assign2_neg.cc | 32 +++++ .../23_containers/deque/debug/assign3_neg.cc | 32 +++++ .../23_containers/deque/debug/assign4_neg.cc | 32 +++++ .../deque/debug/construct1_neg.cc | 32 +++++ .../deque/debug/construct2_neg.cc | 32 +++++ .../deque/debug/construct3_neg.cc | 32 +++++ .../deque/debug/construct4_neg.cc | 32 +++++ .../23_containers/deque/debug/cont_traits.h | 35 +++++ .../deque/debug/debug_cont_traits.h | 35 +++++ .../23_containers/deque/debug/insert1_neg.cc | 32 +++++ .../23_containers/deque/debug/insert2_neg.cc | 32 +++++ .../23_containers/deque/debug/insert3_neg.cc | 32 +++++ .../23_containers/deque/debug/insert4_neg.cc | 32 +++++ .../deque/{ => debug}/invalidation/1.cc | 0 .../deque/{ => debug}/invalidation/2.cc | 0 .../deque/{ => debug}/invalidation/3.cc | 0 .../deque/{ => debug}/invalidation/4.cc | 0 .../23_containers/list/debug/assign1_neg.cc | 32 +++++ .../23_containers/list/debug/assign2_neg.cc | 32 +++++ .../23_containers/list/debug/assign3_neg.cc | 32 +++++ .../23_containers/list/debug/assign4_neg.cc | 32 +++++ .../list/debug/construct1_neg.cc | 32 +++++ .../list/debug/construct2_neg.cc | 32 +++++ .../list/debug/construct3_neg.cc | 32 +++++ .../list/debug/construct4_neg.cc | 32 +++++ .../23_containers/list/debug/cont_traits.h | 35 +++++ .../list/debug/debug_cont_traits.h | 35 +++++ .../23_containers/list/debug/insert1_neg.cc | 32 +++++ .../23_containers/list/debug/insert2_neg.cc | 32 +++++ .../23_containers/list/debug/insert3_neg.cc | 32 +++++ .../23_containers/list/debug/insert4_neg.cc | 32 +++++ .../list/{ => debug}/invalidation/1.cc | 0 .../list/{ => debug}/invalidation/2.cc | 0 .../list/{ => debug}/invalidation/3.cc | 0 .../list/{ => debug}/invalidation/4.cc | 0 .../23_containers/map/debug/construct1_neg.cc | 32 +++++ .../23_containers/map/debug/construct2_neg.cc | 32 +++++ .../23_containers/map/debug/construct3_neg.cc | 32 +++++ .../23_containers/map/debug/construct4_neg.cc | 32 +++++ .../23_containers/map/debug/cont_traits.h | 35 +++++ .../map/debug/debug_cont_traits.h | 35 +++++ .../23_containers/map/debug/insert1_neg.cc | 32 +++++ .../23_containers/map/debug/insert2_neg.cc | 32 +++++ .../23_containers/map/debug/insert3_neg.cc | 32 +++++ .../23_containers/map/debug/insert4_neg.cc | 32 +++++ .../map/{ => debug}/invalidation/1.cc | 0 .../map/{ => debug}/invalidation/2.cc | 0 .../multimap/debug/construct1_neg.cc | 32 +++++ .../multimap/debug/construct2_neg.cc | 32 +++++ .../multimap/debug/construct3_neg.cc | 32 +++++ .../multimap/debug/construct4_neg.cc | 32 +++++ .../multimap/debug/cont_traits.h | 35 +++++ .../multimap/debug/debug_cont_traits.h | 35 +++++ .../multimap/debug/insert1_neg.cc | 32 +++++ .../multimap/debug/insert2_neg.cc | 32 +++++ .../multimap/debug/insert3_neg.cc | 32 +++++ .../multimap/debug/insert4_neg.cc | 32 +++++ .../multimap/{ => debug}/invalidation/1.cc | 0 .../multimap/{ => debug}/invalidation/2.cc | 0 .../multiset/debug/construct1_neg.cc | 32 +++++ .../multiset/debug/construct2_neg.cc | 32 +++++ .../multiset/debug/construct3_neg.cc | 32 +++++ .../multiset/debug/construct4_neg.cc | 32 +++++ .../multiset/debug/cont_traits.h | 35 +++++ .../multiset/debug/debug_cont_traits.h | 35 +++++ .../multiset/debug/insert1_neg.cc | 32 +++++ .../multiset/debug/insert2_neg.cc | 32 +++++ .../multiset/debug/insert3_neg.cc | 32 +++++ .../multiset/debug/insert4_neg.cc | 32 +++++ .../multiset/{ => debug}/invalidation/1.cc | 0 .../multiset/{ => debug}/invalidation/2.cc | 0 .../23_containers/set/debug/construct1_neg.cc | 32 +++++ .../23_containers/set/debug/construct2_neg.cc | 32 +++++ .../23_containers/set/debug/construct3_neg.cc | 32 +++++ .../23_containers/set/debug/construct4_neg.cc | 32 +++++ .../23_containers/set/debug/cont_traits.h | 35 +++++ .../set/debug/debug_cont_traits.h | 35 +++++ .../23_containers/set/debug/insert1_neg.cc | 32 +++++ .../23_containers/set/debug/insert2_neg.cc | 32 +++++ .../23_containers/set/debug/insert3_neg.cc | 32 +++++ .../23_containers/set/debug/insert4_neg.cc | 32 +++++ .../set/{ => debug}/invalidation/1.cc | 0 .../set/{ => debug}/invalidation/2.cc | 0 .../unordered_map/debug/construct1_neg.cc | 33 +++++ .../unordered_map/debug/construct2_neg.cc | 33 +++++ .../unordered_map/debug/construct3_neg.cc | 33 +++++ .../unordered_map/debug/construct4_neg.cc | 33 +++++ .../unordered_map/debug/cont_traits.h | 35 +++++ .../unordered_map/debug/debug_cont_traits.h | 35 +++++ .../unordered_map/debug/insert1_neg.cc | 33 +++++ .../unordered_map/debug/insert2_neg.cc | 33 +++++ .../unordered_map/debug/insert3_neg.cc | 33 +++++ .../unordered_map/debug/insert4_neg.cc | 33 +++++ .../debug/construct1_neg.cc | 33 +++++ .../debug/construct2_neg.cc | 33 +++++ .../debug/construct3_neg.cc | 33 +++++ .../debug/construct4_neg.cc | 33 +++++ .../unordered_multimap/debug/cont_traits.h | 35 +++++ .../debug/debug_cont_traits.h | 35 +++++ .../unordered_multimap/debug/insert1_neg.cc | 33 +++++ .../unordered_multimap/debug/insert2_neg.cc | 33 +++++ .../unordered_multimap/debug/insert3_neg.cc | 33 +++++ .../unordered_multimap/debug/insert4_neg.cc | 33 +++++ .../debug/construct1_neg.cc | 33 +++++ .../debug/construct2_neg.cc | 33 +++++ .../debug/construct3_neg.cc | 33 +++++ .../debug/construct4_neg.cc | 33 +++++ .../unordered_multiset/debug/cont_traits.h | 35 +++++ .../debug/debug_cont_traits.h | 35 +++++ .../unordered_multiset/debug/insert1_neg.cc | 33 +++++ .../unordered_multiset/debug/insert2_neg.cc | 33 +++++ .../unordered_multiset/debug/insert3_neg.cc | 33 +++++ .../unordered_multiset/debug/insert4_neg.cc | 33 +++++ .../unordered_set/debug/construct1_neg.cc | 33 +++++ .../unordered_set/debug/construct2_neg.cc | 33 +++++ .../unordered_set/debug/construct3_neg.cc | 33 +++++ .../unordered_set/debug/construct4_neg.cc | 33 +++++ .../unordered_set/debug/cont_traits.h | 35 +++++ .../unordered_set/debug/debug_cont_traits.h | 35 +++++ .../unordered_set/debug/insert1_neg.cc | 33 +++++ .../unordered_set/debug/insert2_neg.cc | 33 +++++ .../unordered_set/debug/insert3_neg.cc | 33 +++++ .../unordered_set/debug/insert4_neg.cc | 33 +++++ .../23_containers/vector/debug/assign1_neg.cc | 32 +++++ .../23_containers/vector/debug/assign2_neg.cc | 32 +++++ .../23_containers/vector/debug/assign3_neg.cc | 32 +++++ .../23_containers/vector/debug/assign4_neg.cc | 32 +++++ .../vector/debug/construct1_neg.cc | 32 +++++ .../vector/debug/construct2_neg.cc | 32 +++++ .../vector/debug/construct3_neg.cc | 32 +++++ .../vector/debug/construct4_neg.cc | 32 +++++ .../23_containers/vector/debug/cont_traits.h | 35 +++++ .../vector/debug/debug_cont_traits.h | 35 +++++ .../23_containers/vector/debug/insert1_neg.cc | 32 +++++ .../23_containers/vector/debug/insert2_neg.cc | 32 +++++ .../23_containers/vector/debug/insert3_neg.cc | 32 +++++ .../23_containers/vector/debug/insert4_neg.cc | 32 +++++ .../vector/{ => debug}/invalidation/1.cc | 0 .../vector/{ => debug}/invalidation/2.cc | 0 .../vector/{ => debug}/invalidation/3.cc | 0 .../vector/{ => debug}/invalidation/4.cc | 0 .../range_construct/deque_construct.cc | 43 ++++++ .../range_construct/list_construct1.cc | 44 ++++++ .../range_construct/list_construct2.cc | 43 ++++++ .../range_construct/vector_construct.cc | 43 ++++++ .../testsuite/util/debug/assign_neg.h | 136 ++++++++++++++++++ .../testsuite/util/debug/construct_neg.h | 128 +++++++++++++++++ .../testsuite/util/debug/insert_neg.h | 132 +++++++++++++++++ 167 files changed, 4819 insertions(+), 72 deletions(-) rename libstdc++-v3/testsuite/23_containers/bitset/{ => debug}/invalidation/1.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/deque/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/list/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/map/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/map/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/multimap/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/multimap/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/multiset/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/multiset/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/set/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/set/{ => debug}/invalidation/2.cc (100%) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/debug_cont_traits.h create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/1.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/2.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/3.cc (100%) rename libstdc++-v3/testsuite/23_containers/vector/{ => debug}/invalidation/4.cc (100%) create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/deque_construct.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct1.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct2.cc create mode 100644 libstdc++-v3/testsuite/performance/23_containers/range_construct/vector_construct.cc create mode 100644 libstdc++-v3/testsuite/util/debug/assign_neg.h create mode 100644 libstdc++-v3/testsuite/util/debug/construct_neg.h create mode 100644 libstdc++-v3/testsuite/util/debug/insert_neg.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9f72d8400e1..af27275c82a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,109 @@ +2010-08-29 Paolo Carlini + + * testsuite/23_containers/bitset/invalidation: Move... + * testsuite/23_containers/bitset/debug/invalidation: ... here. + * testsuite/23_containers/deque/invalidation: Move... + * testsuite/23_containers/deque/debug/invalidation: ... here. + * testsuite/23_containers/list/invalidation: Move... + * testsuite/23_containers/list/debug/invalidation: ... here. + * testsuite/23_containers/map/invalidation: Move... + * testsuite/23_containers/map/debug/invalidation: ... here. + * testsuite/23_containers/multimap/invalidation: Move... + * testsuite/23_containers/multimap/debug/invalidation: ... here. + * testsuite/23_containers/set/invalidation: Move... + * testsuite/23_containers/set/debug/invalidation: ... here. + * testsuite/23_containers/multiset/invalidation: Move... + * testsuite/23_containers/multiset/debug/invalidation: ... here. + * testsuite/23_containers/vector/invalidation: Move... + * testsuite/23_containers/vector/debug/invalidation: ... here. + +2010-08-29 François Dumont + + * include/bits/stl_algobase.h (_Iter_base): Move... + * include/bits/stl_iterator_base_types.h: ...here. + * include/debug/functions.h (__check_valid_range, __check_string, + __check_sorted): Fix to not depend on _GLIBCXX_DEBUG; include + formatter.h and use formatting macros for a consistent debug result. + * include/debug/formatter.h (__check_singular): Declare; do not + include debug.h. + * include/debug/debug.h: Do not include formatter.h. + * include/debug/safe_iterator.h (_Safe_iterator::_Base_Iterator) + rename to iterator_type. + (__gnu_debug::__base): Add. + * include/debug/set.h: Use everywhere __gnu_debug::__base once + iterator range valided. + * include/debug/unordered_map: Likewise. + * include/debug/multiset.h: Likewise. + * include/debug/vector: Likewise. + * include/debug/unordered_set: Likewise. + * include/debug/deque: Likewise. + * include/debug/map.h: Likewise. + * include/debug/string: Likewise. + * include/debug/list: Likewise. + * include/debug/multimap.h: Likewise. + * testsuite/23_containers/util/debug/assign_neg.h: New test cases on + debug checks performed on container assign operation. + * testsuite/23_containers/util/debug/construct_neg.h: New test cases + on debug checks on constructors. + * testsuite/23_containers/util/debug/insert_neg.h: New test cases on + debug checks performed on container insert operations. + * testsuite/23_containers/unordered_map/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: New. + * testsuite/23_containers/multimap/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/set/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/unordered_multimap/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/unordered_set/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/multiset/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/unordered_multiset/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/map/debug/cont_traits.h, + debug_cont_traits.h, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/vector/debug/cont_traits.h, + debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, + assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/deque/debug/cont_traits.h, + debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, + assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/23_containers/list/debug/cont_traits.h, + debug_cont_traits.h, assign1_neg.cc, assign2_neg.cc, assign3_neg.cc, + assign4_neg.cc, construct1_neg.cc, construct2_neg.cc, + construct3_neg.cc, construct4_neg.cc, insert1_neg.cc, insert2_neg.cc, + insert3_neg.cc, insert4_neg.cc: Likewise. + * testsuite/performance/23_containers/range_construct/ + list_construct1.cc: New, validate performance impact of the patch + on the debug mode. + * testsuite/performance/23_containers/range_construct/ + list_construct2.cc: Likewise. + * testsuite/performance/23_containers/range_construct/ + vector_construct.cc: Likewise. + * testsuite/performance/23_containers/range_construct/ + deque_construct.cc: Likewise. + 2010-08-26 Benjamin Kosnik * include/bits/stl_iterator_base_types.h: Fix doxygen warning. diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index cfaeef8f645..7160bb524aa 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -257,27 +257,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return __a; } - - // If _Iterator has a base returns it otherwise _Iterator is returned - // untouched - template - struct _Iter_base - { - typedef _Iterator iterator_type; - static iterator_type - _S_base(_Iterator __it) - { return __it; } - }; - - template - struct _Iter_base<_Iterator, true> - { - typedef typename _Iterator::iterator_type iterator_type; - static iterator_type - _S_base(_Iterator __it) - { return __it.base(); } - }; - // If _Iterator is a __normal_iterator return its base (a plain pointer, // normally) otherwise return it untouched. See copy, fill, ... template diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h index 70ad8702c66..1a852591345 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_types.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h @@ -175,6 +175,24 @@ _GLIBCXX_BEGIN_NAMESPACE(std) //@} + // If _Iterator has a base returns it otherwise _Iterator is returned + // untouched + template + struct _Iter_base + { + typedef _Iterator iterator_type; + static iterator_type _S_base(_Iterator __it) + { return __it; } + }; + + template + struct _Iter_base<_Iterator, true> + { + typedef typename _Iterator::iterator_type iterator_type; + static iterator_type _S_base(_Iterator __it) + { return __it.base(); } + }; + _GLIBCXX_END_NAMESPACE #endif /* _STL_ITERATOR_BASE_TYPES_H */ diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h index 305299b2f3a..50bf725c1f3 100644 --- a/libstdc++-v3/include/debug/debug.h +++ b/libstdc++-v3/include/debug/debug.h @@ -123,7 +123,6 @@ namespace __gnu_debug # define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N) # include -# include #endif diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index 2b54b7d3e16..9c21598ea67 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -89,7 +89,9 @@ namespace __debug template deque(_InputIterator __first, _InputIterator __last, const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a) + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __a) { } deque(const deque& __x) @@ -143,7 +145,8 @@ namespace __debug assign(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::assign(__first, __last); + _Base::assign(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); } @@ -409,7 +412,8 @@ namespace __debug _InputIterator __first, _InputIterator __last) { __glibcxx_check_insert_range(__position, __first, __last); - _Base::insert(__position.base(), __first, __last); + _Base::insert(__position.base(), __gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); } diff --git a/libstdc++-v3/include/debug/formatter.h b/libstdc++-v3/include/debug/formatter.h index a98ebd84a8d..6945a88af66 100644 --- a/libstdc++-v3/include/debug/formatter.h +++ b/libstdc++-v3/include/debug/formatter.h @@ -32,12 +32,14 @@ #include #include -#include namespace __gnu_debug { using std::type_info; + template + bool __check_singular(_Iterator&); + /** Determine if the two types are the same. */ template struct __is_same diff --git a/libstdc++-v3/include/debug/functions.h b/libstdc++-v3/include/debug/functions.h index 237c0e66909..75ed9ef057f 100644 --- a/libstdc++-v3/include/debug/functions.h +++ b/libstdc++-v3/include/debug/functions.h @@ -33,6 +33,7 @@ #include #include // for iterator_traits, categories #include // for __is_integer +#include namespace __gnu_debug { @@ -153,7 +154,7 @@ namespace __gnu_debug const _InputIterator& __last __attribute__((__unused__))) { - _GLIBCXX_DEBUG_ASSERT(__valid_range(__first, __last)); + __glibcxx_check_valid_range(__first, __last); return __first; } @@ -164,7 +165,7 @@ namespace __gnu_debug const _Integer& __n __attribute__((__unused__))) { #ifdef _GLIBCXX_DEBUG_PEDANTIC - _GLIBCXX_DEBUG_ASSERT(__s != 0 || __n == 0); + __glibcxx_assert(__s != 0 || __n == 0); #endif return __s; } @@ -175,7 +176,7 @@ namespace __gnu_debug __check_string(const _CharT* __s) { #ifdef _GLIBCXX_DEBUG_PEDANTIC - _GLIBCXX_DEBUG_ASSERT(__s != 0); + __glibcxx_assert(__s != 0); #endif return __s; } @@ -242,7 +243,7 @@ namespace __gnu_debug // Verify that the < operator for elements in the sequence is a // StrictWeakOrdering by checking that it is irreflexive. - _GLIBCXX_DEBUG_ASSERT(__first == __last || !(*__first < *__first)); + __glibcxx_assert(__first == __last || !(*__first < *__first)); return __check_sorted_aux(__first, __last, _Category()); } @@ -257,7 +258,7 @@ namespace __gnu_debug // Verify that the predicate is StrictWeakOrdering by checking that it // is irreflexive. - _GLIBCXX_DEBUG_ASSERT(__first == __last || !__pred(*__first, *__first)); + __glibcxx_assert(__first == __last || !__pred(*__first, *__first)); return __check_sorted_aux(__first, __last, __pred, _Category()); } diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index b6be96f00d3..b6567846e9b 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -89,7 +89,9 @@ namespace __debug template list(_InputIterator __first, _InputIterator __last, const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a) + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __a) { } @@ -151,7 +153,8 @@ namespace __debug assign(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::assign(__first, __last); + _Base::assign(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); } @@ -411,7 +414,8 @@ namespace __debug _InputIterator __last) { __glibcxx_check_insert_range(__position, __first, __last); - _Base::insert(__position.base(), __first, __last); + _Base::insert(__position.base(), __gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } iterator diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h index 1254e42257b..0159bcb79f7 100644 --- a/libstdc++-v3/include/debug/map.h +++ b/libstdc++-v3/include/debug/map.h @@ -81,7 +81,9 @@ namespace __debug map(_InputIterator __first, _InputIterator __last, const _Compare& __comp = _Compare(), const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __comp, __a), _Safe_base() { } map(const map& __x) @@ -226,7 +228,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } #ifdef __GXX_EXPERIMENTAL_CXX0X__ diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h index bf06f78f536..5c45ee6bd5d 100644 --- a/libstdc++-v3/include/debug/multimap.h +++ b/libstdc++-v3/include/debug/multimap.h @@ -82,7 +82,9 @@ namespace __debug multimap(_InputIterator __first, _InputIterator __last, const _Compare& __comp = _Compare(), const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __comp, __a) { } multimap(const multimap& __x) @@ -213,7 +215,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } #ifdef __GXX_EXPERIMENTAL_CXX0X__ diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h index 59cc828ce8e..d7d9270fb5e 100644 --- a/libstdc++-v3/include/debug/multiset.h +++ b/libstdc++-v3/include/debug/multiset.h @@ -79,7 +79,9 @@ namespace __debug multiset(_InputIterator __first, _InputIterator __last, const _Compare& __comp = _Compare(), const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __comp, __a) { } multiset(const multiset& __x) @@ -200,12 +202,13 @@ namespace __debug } template - void - insert(_InputIterator __first, _InputIterator __last) - { - __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); - } + void + insert(_InputIterator __first, _InputIterator __last) + { + __glibcxx_check_valid_range(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); + } #ifdef __GXX_EXPERIMENTAL_CXX0X__ void diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h index eb0a3e4ae15..91b059e8a13 100644 --- a/libstdc++-v3/include/debug/safe_iterator.h +++ b/libstdc++-v3/include/debug/safe_iterator.h @@ -1,6 +1,6 @@ // Safe iterator implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2009 +// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -33,9 +33,9 @@ #include #include #include -#include #include #include +#include // for _Iter_base #include namespace __gnu_debug @@ -88,7 +88,7 @@ namespace __gnu_debug typedef std::iterator_traits<_Iterator> _Traits; public: - typedef _Iterator _Base_iterator; + typedef _Iterator iterator_type; typedef typename _Traits::iterator_category iterator_category; typedef typename _Traits::value_type value_type; typedef typename _Traits::difference_type difference_type; @@ -136,7 +136,7 @@ namespace __gnu_debug _Safe_iterator( const _Safe_iterator<_MutableIterator, typename __gnu_cxx::__enable_if<(std::__are_same<_MutableIterator, - typename _Sequence::iterator::_Base_iterator>::__value), + typename _Sequence::iterator::iterator_type>::__value), _Sequence>::__type>& __x) : _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base()) { @@ -638,6 +638,37 @@ namespace __gnu_debug operator+(typename _Safe_iterator<_Iterator,_Sequence>::difference_type __n, const _Safe_iterator<_Iterator, _Sequence>& __i) { return __i + __n; } + + // Helper struct to detect random access safe iterators. + template + struct __is_safe_random_iterator + { + enum { __value = 0 }; + typedef std::__false_type __type; + }; + + template + struct __is_safe_random_iterator<_Safe_iterator<_Iterator, _Sequence> > + : std::__are_same:: + iterator_category> + { }; + + template + struct _Siter_base + : std::_Iter_base<_Iterator, __is_safe_random_iterator<_Iterator>::__value> + { }; + + /** Helper function to extract base iterator of random access safe iterator + in order to reduce performance impact of debug mode. Limited to random + access iterator because it is the only category for which it is possible + to check for correct iterators order in the __valid_range function + thanks to the < operator. + */ + template + inline typename _Siter_base<_Iterator>::iterator_type + __base(_Iterator __it) + { return _Siter_base<_Iterator>::_S_base(__it); } } // namespace __gnu_debug #ifndef _GLIBCXX_EXPORT_TEMPLATE diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h index 24cfcea6411..5cd3f6972e1 100644 --- a/libstdc++-v3/include/debug/set.h +++ b/libstdc++-v3/include/debug/set.h @@ -79,7 +79,9 @@ namespace __debug set(_InputIterator __first, _InputIterator __last, const _Compare& __comp = _Compare(), const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __comp, __a) { } set(const set& __x) @@ -209,7 +211,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } #ifdef __GXX_EXPERIMENTAL_CXX0X__ diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index e5152ebd3cd..4fe0a0686d7 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -107,8 +107,10 @@ namespace __gnu_debug template basic_string(_InputIterator __begin, _InputIterator __end, - const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a) + const _Allocator& __a = _Allocator()) + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__begin, + __end)), + __gnu_debug::__base(__end), __a) { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ @@ -350,7 +352,8 @@ namespace __gnu_debug append(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::append(__first, __last); + _Base::append(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); return *this; } @@ -421,7 +424,8 @@ namespace __gnu_debug assign(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::assign(__first, __last); + _Base::assign(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); return *this; } @@ -501,7 +505,8 @@ namespace __gnu_debug insert(iterator __p, _InputIterator __first, _InputIterator __last) { __glibcxx_check_insert_range(__p, __first, __last); - _Base::insert(__p.base(), __first, __last); + _Base::insert(__p.base(), __gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); } diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 04d311dc408..2e2f9122ee0 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -78,12 +78,14 @@ namespace __debug : _Base(__n, __hf, __eql, __a) { } template - unordered_map(_InputIterator __f, _InputIterator __l, + unordered_map(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __n, __hf, __eql, __a), _Safe_base() { } unordered_map(const unordered_map& __x) @@ -197,7 +199,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } iterator @@ -337,12 +340,14 @@ namespace __debug : _Base(__n, __hf, __eql, __a) { } template - unordered_multimap(_InputIterator __f, _InputIterator __l, + unordered_multimap(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __n, __hf, __eql, __a), _Safe_base() { } unordered_multimap(const unordered_multimap& __x) @@ -448,7 +453,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } iterator diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index 13f869813e5..ea90c675476 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -78,12 +78,14 @@ namespace __debug : _Base(__n, __hf, __eql, __a) { } template - unordered_set(_InputIterator __f, _InputIterator __l, + unordered_set(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __n, __hf, __eql, __a), _Safe_base() { } unordered_set(const unordered_set& __x) @@ -197,7 +199,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } iterator @@ -333,12 +336,14 @@ namespace __debug : _Base(__n, __hf, __eql, __a) { } template - unordered_multiset(_InputIterator __f, _InputIterator __l, + unordered_multiset(_InputIterator __first, _InputIterator __last, size_type __n = 0, const hasher& __hf = hasher(), const key_equal& __eql = key_equal(), const allocator_type& __a = allocator_type()) - : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __n, __hf, __eql, __a), _Safe_base() { } unordered_multiset(const unordered_multiset& __x) @@ -444,7 +449,8 @@ namespace __debug insert(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::insert(__first, __last); + _Base::insert(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); } iterator diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index 3d039655c16..b0846b8f42e 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -94,8 +94,9 @@ namespace __debug template vector(_InputIterator __first, _InputIterator __last, const _Allocator& __a = _Allocator()) - : _Base(__gnu_debug::__check_valid_range(__first, __last), - __last, __a), + : _Base(__gnu_debug::__base(__gnu_debug::__check_valid_range(__first, + __last)), + __gnu_debug::__base(__last), __a), _M_guaranteed_capacity(0) { _M_update_guaranteed_capacity(); } @@ -158,7 +159,8 @@ namespace __debug assign(_InputIterator __first, _InputIterator __last) { __glibcxx_check_valid_range(__first, __last); - _Base::assign(__first, __last); + _Base::assign(__gnu_debug::__base(__first), + __gnu_debug::__base(__last)); this->_M_invalidate_all(); _M_update_guaranteed_capacity(); } @@ -463,7 +465,8 @@ namespace __debug punt here by checking if it did occur. */ typename _Base::iterator __old_begin = _M_base().begin(); difference_type __offset = __position - begin(); - _Base::insert(__position.base(), __first, __last); + _Base::insert(__position.base(), __gnu_debug::__base(__first), + __gnu_debug::__base(__last)); if (_M_base().begin() != __old_begin) this->_M_invalidate_all(); diff --git a/libstdc++-v3/testsuite/23_containers/bitset/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/bitset/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/bitset/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/bitset/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/assign1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/assign1_neg.cc new file mode 100644 index 00000000000..b28e987108f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/assign1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/assign2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/assign2_neg.cc new file mode 100644 index 00000000000..cfff8ac9454 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/assign2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/assign3_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/assign3_neg.cc new file mode 100644 index 00000000000..cfd0bb02332 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/assign3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc new file mode 100644 index 00000000000..115580defc9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/assign4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/deque/debug/cont_traits.h new file mode 100644 index 00000000000..13ab4f9fdf6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::deque cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/deque/debug/debug_cont_traits.h new file mode 100644 index 00000000000..b4dda9250a9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::deque cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/deque/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/deque/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/deque/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/deque/invalidation/3.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/3.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/deque/invalidation/3.cc rename to libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/3.cc diff --git a/libstdc++-v3/testsuite/23_containers/deque/invalidation/4.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/4.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/deque/invalidation/4.cc rename to libstdc++-v3/testsuite/23_containers/deque/debug/invalidation/4.cc diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/assign1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/assign1_neg.cc new file mode 100644 index 00000000000..b28e987108f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/assign1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/assign2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/assign2_neg.cc new file mode 100644 index 00000000000..cfff8ac9454 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/assign2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/assign3_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/assign3_neg.cc new file mode 100644 index 00000000000..cfd0bb02332 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/assign3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc new file mode 100644 index 00000000000..115580defc9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/assign4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/list/debug/cont_traits.h new file mode 100644 index 00000000000..662a97e24ad --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::list cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/list/debug/debug_cont_traits.h new file mode 100644 index 00000000000..4993735433a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::list cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/list/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/list/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/list/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/list/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/list/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/list/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/list/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/list/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/list/invalidation/3.cc b/libstdc++-v3/testsuite/23_containers/list/debug/invalidation/3.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/list/invalidation/3.cc rename to libstdc++-v3/testsuite/23_containers/list/debug/invalidation/3.cc diff --git a/libstdc++-v3/testsuite/23_containers/list/invalidation/4.cc b/libstdc++-v3/testsuite/23_containers/list/debug/invalidation/4.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/list/invalidation/4.cc rename to libstdc++-v3/testsuite/23_containers/list/debug/invalidation/4.cc diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/map/debug/cont_traits.h new file mode 100644 index 00000000000..739ee7a719b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::map cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/map/debug/debug_cont_traits.h new file mode 100644 index 00000000000..34acf372c38 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::map cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/map/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/map/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/map/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/map/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/map/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/map/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/map/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/multimap/debug/cont_traits.h new file mode 100644 index 00000000000..495e3e4861a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::multimap cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/multimap/debug/debug_cont_traits.h new file mode 100644 index 00000000000..98bd1f2f9e6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::multimap cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/multimap/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/multimap/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/multimap/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/multimap/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/multimap/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/multimap/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/multiset/debug/cont_traits.h new file mode 100644 index 00000000000..4e06da23c3a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::multiset cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/multiset/debug/debug_cont_traits.h new file mode 100644 index 00000000000..d5bafe40185 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::multiset cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/multiset/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/multiset/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/multiset/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/multiset/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/multiset/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/multiset/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/set/debug/cont_traits.h new file mode 100644 index 00000000000..fbcc0ff3eb2 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::set cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/set/debug/debug_cont_traits.h new file mode 100644 index 00000000000..5f693769128 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::set cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/set/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/set/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/set/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/set/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/set/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/set/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/set/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc new file mode 100644 index 00000000000..a939d9e90a9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc new file mode 100644 index 00000000000..697db52eaa3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc new file mode 100644 index 00000000000..899f2958d5f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc new file mode 100644 index 00000000000..e2d0efde3a4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/cont_traits.h new file mode 100644 index 00000000000..262b3585454 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::unordered_map cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/debug_cont_traits.h new file mode 100644 index 00000000000..7b3b8c393d7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::unordered_map cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc new file mode 100644 index 00000000000..e9bb1cfe0e7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc new file mode 100644 index 00000000000..c42b8b5696f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc new file mode 100644 index 00000000000..e8d9e9b6714 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc new file mode 100644 index 00000000000..9f3d567714b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct1_neg.cc new file mode 100644 index 00000000000..a939d9e90a9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct2_neg.cc new file mode 100644 index 00000000000..697db52eaa3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct3_neg.cc new file mode 100644 index 00000000000..899f2958d5f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc new file mode 100644 index 00000000000..e2d0efde3a4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/construct4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cont_traits.h new file mode 100644 index 00000000000..1212274c5fa --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::unordered_multimap cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return val_type(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/debug_cont_traits.h new file mode 100644 index 00000000000..d66594dcaf5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::unordered_multimap cont_type; + typedef std::pair val_type; + + static val_type + make_val(Type val) + { return std::pair(val, val); } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert1_neg.cc new file mode 100644 index 00000000000..e9bb1cfe0e7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert2_neg.cc new file mode 100644 index 00000000000..c42b8b5696f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert3_neg.cc new file mode 100644 index 00000000000..e8d9e9b6714 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc new file mode 100644 index 00000000000..9f3d567714b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/debug/insert4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct1_neg.cc new file mode 100644 index 00000000000..a939d9e90a9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct2_neg.cc new file mode 100644 index 00000000000..697db52eaa3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct3_neg.cc new file mode 100644 index 00000000000..899f2958d5f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc new file mode 100644 index 00000000000..e2d0efde3a4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/construct4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/cont_traits.h new file mode 100644 index 00000000000..b82d737483c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::unordered_multiset cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/debug_cont_traits.h new file mode 100644 index 00000000000..7053683e506 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::unordered_multiset cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert1_neg.cc new file mode 100644 index 00000000000..e9bb1cfe0e7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert2_neg.cc new file mode 100644 index 00000000000..c42b8b5696f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert3_neg.cc new file mode 100644 index 00000000000..e8d9e9b6714 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc new file mode 100644 index 00000000000..9f3d567714b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/debug/insert4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct1_neg.cc new file mode 100644 index 00000000000..a939d9e90a9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct2_neg.cc new file mode 100644 index 00000000000..697db52eaa3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct3_neg.cc new file mode 100644 index 00000000000..899f2958d5f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc new file mode 100644 index 00000000000..e2d0efde3a4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/construct4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/cont_traits.h new file mode 100644 index 00000000000..7709f49124e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::unordered_set cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/debug_cont_traits.h new file mode 100644 index 00000000000..f4d6e9bb5be --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::unordered_set cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert1_neg.cc new file mode 100644 index 00000000000..e9bb1cfe0e7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert1_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert2_neg.cc new file mode 100644 index 00000000000..c42b8b5696f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert2_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert3_neg.cc new file mode 100644 index 00000000000..e8d9e9b6714 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert3_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc new file mode 100644 index 00000000000..9f3d567714b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/debug/insert4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc new file mode 100644 index 00000000000..b28e987108f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc new file mode 100644 index 00000000000..cfff8ac9454 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc new file mode 100644 index 00000000000..cfd0bb02332 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc new file mode 100644 index 00000000000..115580defc9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc new file mode 100644 index 00000000000..791c1a296a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc new file mode 100644 index 00000000000..6cac9f03147 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc new file mode 100644 index 00000000000..752c95c671f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc new file mode 100644 index 00000000000..9ee467e0f0f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/cont_traits.h b/libstdc++-v3/testsuite/23_containers/vector/debug/cont_traits.h new file mode 100644 index 00000000000..cdd9a08b444 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef std::vector cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/debug_cont_traits.h b/libstdc++-v3/testsuite/23_containers/vector/debug/debug_cont_traits.h new file mode 100644 index 00000000000..204caff25c9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/debug_cont_traits.h @@ -0,0 +1,35 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include + +template + struct cont_traits + { + typedef __gnu_debug::vector cont_type; + typedef Type val_type; + + static val_type + make_val(Type val) + { return val; } + + template + static void + insert(cont_type& cont, Iter first, Iter last) + { cont.insert(cont.begin(), first, last); } + }; diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc new file mode 100644 index 00000000000..d04b44148ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc new file mode 100644 index 00000000000..106c64adb29 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check2(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc new file mode 100644 index 00000000000..9d3d7b1ad85 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "cont_traits.h" + +void test01() +{ + check3(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc new file mode 100644 index 00000000000..fc49ae65558 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc @@ -0,0 +1,32 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-do run { xfail *-*-* } } + +#include +#include "debug_cont_traits.h" + +void test01() +{ + debug_check1(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/invalidation/1.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/vector/invalidation/1.cc rename to libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/vector/invalidation/2.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/vector/invalidation/2.cc rename to libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc diff --git a/libstdc++-v3/testsuite/23_containers/vector/invalidation/3.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/vector/invalidation/3.cc rename to libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc diff --git a/libstdc++-v3/testsuite/23_containers/vector/invalidation/4.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc similarity index 100% rename from libstdc++-v3/testsuite/23_containers/vector/invalidation/4.cc rename to libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc diff --git a/libstdc++-v3/testsuite/performance/23_containers/range_construct/deque_construct.cc b/libstdc++-v3/testsuite/performance/23_containers/range_construct/deque_construct.cc new file mode 100644 index 00000000000..c8a804ed2b4 --- /dev/null +++ b/libstdc++-v3/testsuite/performance/23_containers/range_construct/deque_construct.cc @@ -0,0 +1,43 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// Performance test of debug mode deque range constructor +#define _GLIBCXX_DEBUG + +#include +#include + +int main() +{ + using namespace __gnu_test; + + time_counter time; + resource_counter resource; + + const std::deque ref(50000, 3); + + start_counters(time, resource); + + for (unsigned i = 0; i < 1000; ++i) + std::deque v(ref.begin(), ref.end()); + + stop_counters(time, resource); + report_performance(__FILE__, "", time, resource); + + return 0; +} diff --git a/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct1.cc b/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct1.cc new file mode 100644 index 00000000000..19224ad2f5e --- /dev/null +++ b/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct1.cc @@ -0,0 +1,44 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// Performance test of debug mode list range constructor +#define _GLIBCXX_DEBUG + +#include +#include +#include + +int main() +{ + using namespace __gnu_test; + + time_counter time; + resource_counter resource; + + const std::vector ref(50000, 3); + + start_counters(time, resource); + + for (unsigned i = 0; i < 1000; ++i) + std::list l(ref.begin(), ref.end()); + + stop_counters(time, resource); + report_performance(__FILE__, "", time, resource); + + return 0; +} diff --git a/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct2.cc b/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct2.cc new file mode 100644 index 00000000000..51bc7a17bd1 --- /dev/null +++ b/libstdc++-v3/testsuite/performance/23_containers/range_construct/list_construct2.cc @@ -0,0 +1,43 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// Performance test of debug mode list range constructor +#define _GLIBCXX_DEBUG + +#include +#include + +int main() +{ + using namespace __gnu_test; + + time_counter time; + resource_counter resource; + + const std::list ref(50000, 3); + + start_counters(time, resource); + + for (unsigned i = 0; i < 1000; ++i) + std::list l(ref.begin(), ref.end()); + + stop_counters(time, resource); + report_performance(__FILE__, "", time, resource); + + return 0; +} diff --git a/libstdc++-v3/testsuite/performance/23_containers/range_construct/vector_construct.cc b/libstdc++-v3/testsuite/performance/23_containers/range_construct/vector_construct.cc new file mode 100644 index 00000000000..08716a543ac --- /dev/null +++ b/libstdc++-v3/testsuite/performance/23_containers/range_construct/vector_construct.cc @@ -0,0 +1,43 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// Performance test of debug mode vector range constructor +#define _GLIBCXX_DEBUG + +#include +#include + +int main() +{ + using namespace __gnu_test; + + time_counter time; + resource_counter resource; + + const std::vector ref(50000, 3); + + start_counters(time, resource); + + for (unsigned i = 0; i < 1000; ++i) + std::vector v(ref.begin(), ref.end()); + + stop_counters(time, resource); + report_performance(__FILE__, "", time, resource); + + return 0; +} diff --git a/libstdc++-v3/testsuite/util/debug/assign_neg.h b/libstdc++-v3/testsuite/util/debug/assign_neg.h new file mode 100644 index 00000000000..332c716c297 --- /dev/null +++ b/libstdc++-v3/testsuite/util/debug/assign_neg.h @@ -0,0 +1,136 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +#include +#include +#include + +// Check that invalid range of pointers is detected +template