aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/libstdc++-v3/testsuite/23_containers/vector')
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/14340.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/15523.cc39
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/18604.cc41
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-1.cc28
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-2.cc26
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/40192.cc28
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/52591.cc38
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc57
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc61
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc46
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc61
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/noexcept.cc76
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc78
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/1.cc36
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc35
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc39
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/6886.cc53
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/1.cc137
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/29134.cc53
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/shrink_to_fit.cc40
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/clear_allocator.cc87
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/1.cc178
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/2.cc180
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/noexcept_move_construct.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc45
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/erase/1.cc136
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/1.cc171
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc200
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/1.cc145
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/2.cc174
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc30
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/swap.cc59
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/1.cc60
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/2.cc102
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134-2.cc50
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134.cc37
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/44190.cc38
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/8230.cc77
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable.cc47
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable2.cc45
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/1.cc55
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable.cc55
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable2.cc57
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/resize_size.cc43
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc42
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit2.cc61
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc76
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/1.cc46
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/2.cc47
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/3.cc52
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/4.cc584
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/6513.cc38
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/clear_allocator.cc87
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/cons_size.cc40
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable.cc62
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc55
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/noexcept_move_construct.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/data_access/1.cc50
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc43
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/alloc_prop.cc89
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc32
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/bool/shrink_to_fit.cc42
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc32
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc33
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc32
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc59
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc64
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc89
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc66
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/iterator_self_move_assign_neg.cc35
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc100
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/self_move_assign_neg.cc34
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/shrink_to_fit.cc40
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-1.cc50
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-2.cc52
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/element_access/1.cc61
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/citerators.cc45
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/data_access.cc52
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/1.cc26
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/element.cc77
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/erase.cc139
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/insert.cc66
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/resize.cc64
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/1.cc60
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/2.cc62
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/init-list.cc60
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/1.cc55
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/2.cc61
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc28
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/1.cc135
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc38
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/moveable.cc62
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/1.cc49
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable.cc137
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable2.cc77
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc50
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/1.cc62
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/2.cc132
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/3.cc161
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc24
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/range_access.cc35
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc30
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/do_the_right_thing.cc29
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc34
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor.cc27
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc28
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc29
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc34
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc40
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc34
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc34
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1.cc25
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1_c++0x.cc25
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/2.cc30
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc26
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/4.cc29
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/partial_specialization/1.cc32
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc25
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/1.cc41
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/23767.cc43
-rw-r--r--gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/zero_sized_allocations.cc68
132 files changed, 8088 insertions, 0 deletions
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/14340.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/14340.cc
new file mode 100644
index 000000000..5e3a30f8b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/14340.cc
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_hooks.h>
+#include <vector>
+
+// NB: This issue affected only debug-mode.
+
+// { dg-do compile }
+
+// libstdc++/14340
+int main()
+{
+ typedef std::vector<int> container;
+ __gnu_test::conversion<container>::iterator_to_const_iterator();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/15523.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/15523.cc
new file mode 100644
index 000000000..7fb0b48c4
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/15523.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// NB: This issue affected only debug-mode.
+
+#include <vector>
+
+// libstdc++/15523
+void test01()
+{
+ using namespace std;
+
+ vector<vector<int>::const_iterator> x(2);
+
+ vector<int>::iterator i2, i3;
+ vector<int>::const_iterator ci1(i2);
+
+ i2 = i3;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/18604.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/18604.cc
new file mode 100644
index 000000000..b0bd6bd77
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/18604.cc
@@ -0,0 +1,41 @@
+// 2005-05-09 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// NB: This issue affected only debug-mode.
+
+// { dg-do compile }
+
+// libstdc++/18604
+struct less;
+struct allocator;
+struct pair;
+struct binary_function;
+struct iterator;
+struct iterator_traits;
+struct bidirectional_iterator_tag;
+struct forward_iterator_tag;
+struct input_iterator_tag;
+struct random_access_iterator_tag;
+struct ios_base;
+struct basic_string;
+struct basic_istream;
+struct basic_ostream;
+struct char_traits;
+
+#include <vector>
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-1.cc
new file mode 100644
index 000000000..5c3bd956d
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-1.cc
@@ -0,0 +1,28 @@
+// { dg-do compile }
+// -*- C++ -*-
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+
+// libstdc++26412
+namespace debug
+{
+ int i;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-2.cc
new file mode 100644
index 000000000..eee19d572
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/26412-2.cc
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// -*- C++ -*-
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#define debug 0
+
+#include <debug/vector>
+
+// libstdc++26412
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/40192.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/40192.cc
new file mode 100644
index 000000000..8c8bae692
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/40192.cc
@@ -0,0 +1,28 @@
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+// libstdc++/40192
+
+#include <vector>
+
+void test01()
+{
+ typedef float float4[4];
+ std::vector<float4> vals;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/52591.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/52591.cc
new file mode 100644
index 000000000..03d8f43c7
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/52591.cc
@@ -0,0 +1,38 @@
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// libstdc++/52591
+
+#include <vector>
+
+// As an extension we allow move-assignment of std::vector when the element
+// type is not MoveAssignable, as long as the allocator type propagates or
+// is known to always compare equal.
+
+struct C
+{
+ C& operator=(C&&) = delete;
+};
+
+void test01()
+{
+ std::vector<C> a;
+ a = std::vector<C>();
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc
new file mode 100644
index 000000000..f95c345b8
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy.cc
@@ -0,0 +1,57 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::propagating_allocator;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, false> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(v1);
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(0 == v2.get_allocator().get_personality());
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, true> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(v1);
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(1 == v2.get_allocator().get_personality());
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc
new file mode 100644
index 000000000..89aac6f56
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/copy_assign.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::propagating_allocator;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, false> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(alloc_type(2));
+ v2.push_back(T());
+ v2 = v1;
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(2 == v2.get_allocator().get_personality());
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, true> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(alloc_type(2));
+ v2.push_back(T());
+ v2 = v1;
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(1 == v2.get_allocator().get_personality());
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc
new file mode 100644
index 000000000..1b66b5097
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/minimal.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <memory>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::SimpleAllocator;
+
+template class std::vector<T, SimpleAllocator<T>>;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef SimpleAllocator<T> alloc_type;
+ typedef std::allocator_traits<alloc_type> traits_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v(alloc_type{});
+ v.push_back(T());
+ VERIFY( v.max_size() == traits_type::max_size(v.get_allocator()) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc
new file mode 100644
index 000000000..64795d361
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/move_assign.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::propagating_allocator;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, false> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(alloc_type(2));
+ v2.push_back(T());
+ v2 = std::move(v1);
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(2 == v2.get_allocator().get_personality());
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, true> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(alloc_type(2));
+ v2 = std::move(v1);
+ v2.push_back(T());
+ VERIFY(0 == v1.get_allocator().get_personality());
+ VERIFY(1 == v2.get_allocator().get_personality());
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/noexcept.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/noexcept.cc
new file mode 100644
index 000000000..a805a4f0a
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/noexcept.cc
@@ -0,0 +1,76 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+namespace __gnu_test
+{
+ inline void
+ swap(propagating_allocator<T, true>& l, propagating_allocator<T, true>& r)
+ noexcept(false)
+ {
+ typedef uneq_allocator<T> base_alloc;
+ swap(static_cast<base_alloc&>(l), static_cast<base_alloc&>(r));
+ }
+}
+
+using __gnu_test::propagating_allocator;
+
+void test01()
+{
+ typedef std::allocator<T> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1;
+ test_type v2;
+ // this is a GNU extension for std::allocator
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
+}
+
+void test02()
+{
+ typedef propagating_allocator<T, false> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ test_type v2(alloc_type(2));
+ static_assert( !noexcept( v1 = std::move(v2) ), "Move assign can throw" );
+ static_assert( noexcept( v1.swap(v2) ), "Swap cannot throw" );
+}
+
+void test03()
+{
+ typedef propagating_allocator<T, true> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ test_type v2(alloc_type(2));
+ static_assert( noexcept( v1 = std::move(v2) ), "Move assign cannot throw" );
+ static_assert( !noexcept( v1.swap(v2) ), "Swap can throw" );
+}
+
+int main()
+{
+ test01();
+ test02();
+ test03();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc
new file mode 100644
index 000000000..ce44cf80f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/allocator/swap.cc
@@ -0,0 +1,78 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+struct T { int i; };
+
+using __gnu_test::propagating_allocator;
+
+// It is undefined behaviour to swap() containers wth unequal allocators
+// if the allocator doesn't propagate, so ensure the allocators compare
+// equal, while still being able to test propagation via get_personality().
+bool
+operator==(const propagating_allocator<T, false>&,
+ const propagating_allocator<T, false>&)
+{
+ return true;
+}
+
+bool
+operator!=(const propagating_allocator<T, false>&,
+ const propagating_allocator<T, false>&)
+{
+ return false;
+}
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, false> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ v1.push_back(T());
+ test_type v2(alloc_type(2));
+ v2.push_back(T());
+ std::swap(v1, v2);
+ VERIFY(1 == v1.get_allocator().get_personality());
+ VERIFY(2 == v2.get_allocator().get_personality());
+ // swap back so assertions in uneq_allocator::deallocate don't fail
+ std::swap(v1, v2);
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef propagating_allocator<T, true> alloc_type;
+ typedef std::vector<T, alloc_type> test_type;
+ test_type v1(alloc_type(1));
+ test_type v2(alloc_type(2));
+ std::swap(v1, v2);
+ VERIFY(2 == v1.get_allocator().get_personality());
+ VERIFY(1 == v2.get_allocator().get_personality());
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/1.cc
new file mode 100644
index 000000000..c45f73527
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/1.cc
@@ -0,0 +1,36 @@
+// 2002-03-05 Stephen M. Webb <stephen.webb@bregmasoft.com>
+
+// Copyright (C) 2002-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 class vector<bool>
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ std::vector<bool>::iterator i;
+ if (false)
+ ++i;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc
new file mode 100644
index 000000000..08c49fde9
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+// { dg-do compile }
+
+class Foo
+{
+};
+
+template<class T> Foo operator/(const Foo& arg1, T arg2)
+{
+ return Foo();
+}
+
+// libstdc++/21244
+void foo()
+{
+ std::vector<bool> bar(1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc
new file mode 100644
index 000000000..8264ae158
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+#include <vector>
+
+// libstdc++/23632
+void test01()
+{
+ std::vector<bool> v(100);
+ const std::vector<bool>::iterator fu = v.begin();
+ if (!fu[0])
+ fu[0] = true;
+
+ const std::vector<bool>::const_iterator cfu = v.begin();
+ if (cfu[0])
+ ;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/6886.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/6886.cc
new file mode 100644
index 000000000..5aa51c452
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/6886.cc
@@ -0,0 +1,53 @@
+// 2002-03-05 Stephen M. Webb <stephen.webb@bregmasoft.com>
+
+// Copyright (C) 2002-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 class vector<bool>
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// libstdc++/6886
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::vector<bool> bvec;
+ int i, num = 0;
+ bvec v;
+
+ v.resize(66);
+
+ for (i = 0 ; i < 66 ; ++i)
+ v[i] = 0;
+
+ v[1] = 1;
+ v[33] = 1;
+ v[49] = 1;
+ v[65] = 1;
+
+ for (bvec::iterator j = v.begin() ; j != v.end() ; j++)
+ if (bool(*j)) ++num;
+
+ VERIFY( num == 4 );
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/1.cc
new file mode 100644
index 000000000..f124f84a1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/1.cc
@@ -0,0 +1,137 @@
+// 2006-08-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool> resize
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const bool A1[] = {0};
+const bool A2[] = {0, 0, 0};
+const bool A3[] = {0, 0};
+const bool A4[] = {0, 0, 1, 1, 1, 1, 1};
+const bool A5[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+const bool A6[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1};
+const bool A7[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0};
+const bool A8[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+const bool A9[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+const bool A10[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1};
+const bool A11[] = {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0};
+
+const unsigned N1 = sizeof(A1) / sizeof(bool);
+const unsigned N2 = sizeof(A2) / sizeof(bool);
+const unsigned N3 = sizeof(A3) / sizeof(bool);
+const unsigned N4 = sizeof(A4) / sizeof(bool);
+const unsigned N5 = sizeof(A5) / sizeof(bool);
+const unsigned N6 = sizeof(A6) / sizeof(bool);
+const unsigned N7 = sizeof(A7) / sizeof(bool);
+const unsigned N8 = sizeof(A8) / sizeof(bool);
+const unsigned N9 = sizeof(A9) / sizeof(bool);
+const unsigned N10 = sizeof(A10) / sizeof(bool);
+const unsigned N11 = sizeof(A11) / sizeof(bool);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<bool> vec_type;
+
+ vec_type v;
+
+ v.resize(1);
+ VERIFY( v.size() == 1 );
+ VERIFY( std::equal(v.begin(), v.end(), A1) );
+
+ v.resize(3);
+ VERIFY( v.size() == 3 );
+ VERIFY( std::equal(v.begin(), v.end(), A2) );
+
+ v.resize(2);
+ VERIFY( v.size() == 2 );
+ VERIFY( std::equal(v.begin(), v.end(), A3) );
+
+ v.resize(7, true);
+ VERIFY( v.size() == 7 );
+ VERIFY( std::equal(v.begin(), v.end(), A4) );
+
+ v.resize(18, false);
+ VERIFY( v.size() == 18 );
+ VERIFY( std::equal(v.begin(), v.end(), A5) );
+
+ v.resize(40, true);
+ VERIFY( v.size() == 40 );
+ VERIFY( std::equal(v.begin(), v.end(), A6) );
+
+ v.resize(80, false);
+ VERIFY( v.size() == 80 );
+ VERIFY( std::equal(v.begin(), v.end(), A7) );
+
+ v.resize(90, true);
+ VERIFY( v.size() == 90 );
+ VERIFY( std::equal(v.begin(), v.end(), A8) );
+
+ v.resize(100, false);
+ VERIFY( v.size() == 100 );
+ VERIFY( std::equal(v.begin(), v.end(), A9) );
+
+ v.resize(200, true);
+ VERIFY( v.size() == 200 );
+ VERIFY( std::equal(v.begin(), v.end(), A10) );
+
+ v.resize(13, true);
+ VERIFY( v.size() == 13 );
+ VERIFY( std::equal(v.begin(), v.end(), A11) );
+
+ v.resize(13, false);
+ VERIFY( v.size() == 13 );
+ VERIFY( std::equal(v.begin(), v.end(), A11) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/29134.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/29134.cc
new file mode 100644
index 000000000..f720493c4
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/29134.cc
@@ -0,0 +1,53 @@
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 class vector<bool> [lib.vector.bool]
+
+#include <vector>
+#include <limits>
+#include <testsuite_hooks.h>
+
+// libstdc++/29134
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ using std::vector;
+ using std::numeric_limits;
+
+#ifdef _GLIBCXX_DEBUG
+ using std::_GLIBCXX_STD_C::_S_word_bit;
+#elif defined(_GLIBCXX_PROFILE)
+ using std::_GLIBCXX_STD_C::_S_word_bit;
+#else
+ using std::_S_word_bit;
+#endif
+
+ // Actually, vector<bool> is special, see libstdc++/31370.
+ vector<bool> vb;
+ typedef vector<bool>::difference_type difference_type;
+ typedef vector<bool>::size_type size_type;
+ VERIFY( vb.max_size()
+ == size_type(numeric_limits<difference_type>::max()
+ - int(_S_word_bit) + 1) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/shrink_to_fit.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/shrink_to_fit.cc
new file mode 100644
index 000000000..63b5ab0c1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/capacity/shrink_to_fit.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<bool> vb(__CHAR_BIT__ * sizeof(unsigned long) + 1);
+ vb.pop_back();
+
+ auto old_capacity = vb.capacity();
+ vb.shrink_to_fit();
+ VERIFY( vb.capacity() < old_capacity );
+ VERIFY( vb.size() == vb.capacity() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/clear_allocator.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/clear_allocator.cc
new file mode 100644
index 000000000..dd8951f9b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/clear_allocator.cc
@@ -0,0 +1,87 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <ext/new_allocator.h>
+
+using namespace std;
+using __gnu_cxx::new_allocator;
+
+template<typename T>
+ class clear_alloc : public new_allocator<T>
+ {
+ public:
+
+ template <typename T1>
+ struct rebind
+ { typedef clear_alloc<T1> other; };
+
+ virtual void clear() throw()
+ { }
+
+ clear_alloc() throw()
+ { }
+
+ clear_alloc(clear_alloc const&) throw() : new_allocator<T>()
+ { }
+
+ template<typename T1>
+ clear_alloc(clear_alloc<T1> const&) throw()
+ { }
+
+ virtual ~clear_alloc() throw()
+ { this->clear(); }
+
+ T* allocate(typename new_allocator<T>::size_type n, const void *hint = 0)
+ {
+ this->clear();
+ return new_allocator<T>::allocate(n, hint);
+ }
+
+ void deallocate(T *ptr, typename new_allocator<T>::size_type n)
+ {
+ this->clear();
+ new_allocator<T>::deallocate(ptr, n);
+ }
+ };
+
+template<typename Container>
+ void Check_Container()
+ {
+ Container* pic = new Container;
+ int x = 230;
+
+ while (x--)
+ {
+ pic->push_back(x);
+ }
+
+ pic->get_allocator();
+
+ // The following has led to infinite recursions or cores.
+ pic->clear();
+
+ delete pic;
+ }
+
+
+int main()
+{
+ Check_Container<std::vector<bool, clear_alloc<bool> > >();
+ return 0;
+}
+
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/1.cc
new file mode 100644
index 000000000..c5dc05085
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/1.cc
@@ -0,0 +1,178 @@
+// 2006-08-09 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool> copy construct
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const bool A1[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 1, 1};
+const bool A2[] = {1, 0, 1, 1, 1, 1, 1};
+const bool A3[] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A4[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1};
+const bool A5[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1};
+const bool A6[] = {1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A7[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0};
+const bool A8[] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+const bool A9[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+
+const unsigned N1 = sizeof(A1) / sizeof(bool);
+const unsigned N2 = sizeof(A2) / sizeof(bool);
+const unsigned N3 = sizeof(A3) / sizeof(bool);
+const unsigned N4 = sizeof(A4) / sizeof(bool);
+const unsigned N5 = sizeof(A5) / sizeof(bool);
+const unsigned N6 = sizeof(A6) / sizeof(bool);
+const unsigned N7 = sizeof(A7) / sizeof(bool);
+const unsigned N8 = sizeof(A8) / sizeof(bool);
+const unsigned N9 = sizeof(A9) / sizeof(bool);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<bool> vec_type;
+
+ const vec_type v1_ref(A1, A1 + N1);
+ vec_type v1(v1_ref);
+ VERIFY( v1.size() == v1_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v1_ref.begin()) );
+
+ const vec_type v2_ref(A2, A2 + N2);
+ vec_type v2(v2_ref);
+ VERIFY( v2.size() == v2_ref.size() );
+ VERIFY( std::equal(v2.begin(), v2.end(), v2_ref.begin()) );
+
+ const vec_type v3_ref(A3, A3 + N3);
+ vec_type v3(v3_ref);
+ VERIFY( v3.size() == v3_ref.size() );
+ VERIFY( std::equal(v3.begin(), v3.end(), v3_ref.begin()) );
+
+ const vec_type v4_ref(A4, A4 + N4);
+ vec_type v4(v4_ref);
+ VERIFY( v4.size() == v4_ref.size() );
+ VERIFY( std::equal(v4.begin(), v4.end(), v4_ref.begin()) );
+
+ const vec_type v5_ref(A5, A5 + N5);
+ vec_type v5(v5_ref);
+ VERIFY( v5.size() == v5_ref.size() );
+ VERIFY( std::equal(v5.begin(), v5.end(), v5_ref.begin()) );
+
+ const vec_type v6_ref(A6, A6 + N6);
+ vec_type v6(v6_ref);
+ VERIFY( v6.size() == v6_ref.size() );
+ VERIFY( std::equal(v6.begin(), v6.end(), v6_ref.begin()) );
+
+ const vec_type v7_ref(A7, A7 + N7);
+ vec_type v7(v7_ref);
+ VERIFY( v7.size() == v7_ref.size() );
+ VERIFY( std::equal(v7.begin(), v7.end(), v7_ref.begin()) );
+
+ const vec_type v8_ref(A8, A8 + N8);
+ vec_type v8(v8_ref);
+ VERIFY( v8.size() == v8_ref.size() );
+ VERIFY( std::equal(v8.begin(), v8.end(), v8_ref.begin()) );
+
+ const vec_type v9_ref(A9, A9 + N9);
+ vec_type v9(v9_ref);
+ VERIFY( v9.size() == v9_ref.size() );
+ VERIFY( std::equal(v9.begin(), v9.end(), v9_ref.begin()) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/2.cc
new file mode 100644
index 000000000..c3330ebef
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/2.cc
@@ -0,0 +1,180 @@
+// 2006-08-09 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool> assignment operator
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const bool A1[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 1, 1};
+const bool A2[] = {1, 0, 1, 1, 1, 1, 1};
+const bool A3[] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A4[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1};
+const bool A5[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1};
+const bool A6[] = {1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A7[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0};
+const bool A8[] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+const bool A9[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+
+const unsigned N1 = sizeof(A1) / sizeof(bool);
+const unsigned N2 = sizeof(A2) / sizeof(bool);
+const unsigned N3 = sizeof(A3) / sizeof(bool);
+const unsigned N4 = sizeof(A4) / sizeof(bool);
+const unsigned N5 = sizeof(A5) / sizeof(bool);
+const unsigned N6 = sizeof(A6) / sizeof(bool);
+const unsigned N7 = sizeof(A7) / sizeof(bool);
+const unsigned N8 = sizeof(A8) / sizeof(bool);
+const unsigned N9 = sizeof(A9) / sizeof(bool);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<bool> vec_type;
+
+ vec_type v1;
+
+ const vec_type v1_ref(A1, A1 + N1);
+ v1 = v1_ref;
+ VERIFY( v1.size() == v1_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v1_ref.begin()) );
+
+ const vec_type v2_ref(A2, A2 + N2);
+ v1 = v2_ref;
+ VERIFY( v1.size() == v2_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v2_ref.begin()) );
+
+ const vec_type v3_ref(A3, A3 + N3);
+ v1 = v3_ref;
+ VERIFY( v1.size() == v3_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v3_ref.begin()) );
+
+ const vec_type v4_ref(A4, A4 + N4);
+ v1 = v4_ref;
+ VERIFY( v1.size() == v4_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v4_ref.begin()) );
+
+ const vec_type v5_ref(A5, A5 + N5);
+ v1 = v5_ref;
+ VERIFY( v1.size() == v5_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v5_ref.begin()) );
+
+ const vec_type v6_ref(A6, A6 + N6);
+ v1 = v6_ref;
+ VERIFY( v1.size() == v6_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v6_ref.begin()) );
+
+ const vec_type v7_ref(A7, A7 + N7);
+ v1 = v7_ref;
+ VERIFY( v1.size() == v7_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v7_ref.begin()) );
+
+ const vec_type v8_ref(A8, A8 + N8);
+ v1 = v8_ref;
+ VERIFY( v1.size() == v8_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v8_ref.begin()) );
+
+ const vec_type v9_ref(A9, A9 + N9);
+ v1 = v9_ref;
+ VERIFY( v1.size() == v9_ref.size() );
+ VERIFY( std::equal(v1.begin(), v1.end(), v9_ref.begin()) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/noexcept_move_construct.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/noexcept_move_construct.cc
new file mode 100644
index 000000000..143856c9e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/cons/noexcept_move_construct.cc
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+typedef std::vector<bool> vbtype;
+
+static_assert(std::is_nothrow_move_constructible<vbtype>::value, "Error");
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc
new file mode 100644
index 000000000..3cc7447d3
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/hash/1.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+void test01()
+{
+ std::vector<bool> b0;
+ std::hash<std::vector<bool>> h0;
+ h0(b0);
+
+ std::vector<bool> b1(10);
+ std::hash<std::vector<bool>> h1;
+ h1(b1);
+
+ std::vector<bool> b2(100);
+ std::hash<std::vector<bool>> h2;
+ h2(b2);
+
+ std::vector<bool> b3(1000);
+ std::hash<std::vector<bool>> h3;
+ h3(b3);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/erase/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/erase/1.cc
new file mode 100644
index 000000000..e1d6976d6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/erase/1.cc
@@ -0,0 +1,136 @@
+// 2005-12-23 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool> modifiers
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const bool A[] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+const bool A1[] = {0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+const bool A2[] = {0, 0, 1, 0, 0, 1, 0, 1, 0, 1};
+const bool A3[] = {0, 0, 1, 0, 0, 1};
+const bool A4[] = {0, 0, 1};
+const bool A5[] = {0, 0};
+
+const unsigned N = sizeof(A) / sizeof(bool);
+const unsigned N1 = sizeof(A1) / sizeof(bool);
+const unsigned N2 = sizeof(A2) / sizeof(bool);
+const unsigned N3 = sizeof(A3) / sizeof(bool);
+const unsigned N4 = sizeof(A4) / sizeof(bool);
+const unsigned N5 = sizeof(A5) / sizeof(bool);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<bool> vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v(A, A + N);
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), A1) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), A2) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), A3) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), A4) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), A5) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+void
+test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<std::vector<bool> > vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v, v1, v2, v3, v4, v5;
+ for (unsigned i = 0; i < N; ++i)
+ v.push_back(std::vector<bool>(1, A[i]));
+ for (unsigned i = 0; i < N1; ++i)
+ v1.push_back(std::vector<bool>(1, A1[i]));
+ for (unsigned i = 0; i < N2; ++i)
+ v2.push_back(std::vector<bool>(1, A2[i]));
+ for (unsigned i = 0; i < N3; ++i)
+ v3.push_back(std::vector<bool>(1, A3[i]));
+ for (unsigned i = 0; i < N4; ++i)
+ v4.push_back(std::vector<bool>(1, A4[i]));
+ for (unsigned i = 0; i < N5; ++i)
+ v5.push_back(std::vector<bool>(1, A5[i]));
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), v1.begin()) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), v2.begin()) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), v3.begin()) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), v4.begin()) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), v5.begin()) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/1.cc
new file mode 100644
index 000000000..2b76d08a1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/1.cc
@@ -0,0 +1,171 @@
+// 2006-08-05 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool> insert
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const bool A1[] = {1, 1, 1, 1, 1, 1, 1};
+const bool A2[] = {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A3[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1};
+const bool A4[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1};
+const bool A5[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+const bool A6[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1};
+const bool A7[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0};
+const bool A8[] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+const bool A9[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 1, 0};
+
+const unsigned N1 = sizeof(A1) / sizeof(bool);
+const unsigned N2 = sizeof(A2) / sizeof(bool);
+const unsigned N3 = sizeof(A3) / sizeof(bool);
+const unsigned N4 = sizeof(A4) / sizeof(bool);
+const unsigned N5 = sizeof(A5) / sizeof(bool);
+const unsigned N6 = sizeof(A6) / sizeof(bool);
+const unsigned N7 = sizeof(A7) / sizeof(bool);
+const unsigned N8 = sizeof(A8) / sizeof(bool);
+const unsigned N9 = sizeof(A9) / sizeof(bool);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<bool> vec_type;
+
+ vec_type v;
+
+ v.insert(v.begin(), 7, true);
+ VERIFY( v.size() == 7 );
+ VERIFY( std::equal(v.begin(), v.end(), A1) );
+
+ v.insert(v.begin() + 5, 10, false);
+ VERIFY( v.size() == 17 );
+ VERIFY( std::equal(v.begin(), v.end(), A2) );
+
+ v.insert(v.begin(), 20, false);
+ VERIFY( v.size() == 37 );
+ VERIFY( std::equal(v.begin(), v.end(), A3) );
+
+ v.insert(v.begin(), 40, true);
+ VERIFY( v.size() == 77 );
+ VERIFY( std::equal(v.begin(), v.end(), A4) );
+
+ v.insert(v.begin() + 18, 80, false);
+ VERIFY( v.size() == 157 );
+ VERIFY( std::equal(v.begin(), v.end(), A5) );
+
+ v.insert(v.begin() + 54, 80, true);
+ VERIFY( v.size() == 237 );
+ VERIFY( std::equal(v.begin(), v.end(), A6) );
+
+ v.insert(v.end(), 1, false);
+ VERIFY( v.size() == 238 );
+ VERIFY( std::equal(v.begin(), v.end(), A7) );
+
+ v.insert(v.begin(), 1, false);
+ VERIFY( v.size() == 239 );
+ VERIFY( std::equal(v.begin(), v.end(), A8) );
+
+ v.insert(v.begin(), 180, true);
+ VERIFY( v.size() == 419 );
+ VERIFY( std::equal(v.begin(), v.end(), A9) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc
new file mode 100644
index 000000000..143345121
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc
@@ -0,0 +1,200 @@
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 class vector<bool> [lib.vector.bool]
+
+// { dg-skip-if "" { powerpc64-*-freebsd* } { "*" } { "" } }
+// { dg-do run { xfail *-*-darwin8.[0-4].* } }
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+#ifdef _GLIBCXX_DEBUG
+ using std::_GLIBCXX_STD_C::_S_word_bit;
+#elif defined(_GLIBCXX_PROFILE)
+ using std::_GLIBCXX_STD_C::_S_word_bit;
+#else
+ using std::_S_word_bit;
+#endif
+
+inline void
+check_cap_ge_size(const std::vector<bool>& x)
+{
+ if (x.capacity() < x.size())
+ throw std::logic_error("");
+}
+
+inline void
+check_cap_eq_maxsize(const std::vector<bool>& x)
+{
+ if (x.capacity() != x.max_size())
+ throw std::logic_error("");
+}
+
+// libstdc++/31370
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ int myexit = 0;
+
+ try
+ {
+ std::vector<bool> x;
+ x.reserve(x.max_size());
+ check_cap_eq_maxsize(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ // When doubling is too big, but smaller is sufficient, the resize
+ // should do smaller and be happy. It certainly shouldn't throw
+ // other exceptions or crash.
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() / 2 + 1, false);
+ for(int i = 0; i < _S_word_bit; ++i)
+ x.push_back(false);
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() / 2 + 1, false);
+ x.insert(x.end(), _S_word_bit, false);
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() / 2 + 1, false);
+ std::vector<bool> y(_S_word_bit, false);
+ x.insert(x.end(), y.begin(), y.end());
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ // These tests are currently only relevant to bool: don't get burned
+ // by the attempt to round up when near the max size.
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ for(int i = 0; i < _S_word_bit; ++i)
+ x.push_back(false);
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ x.insert(x.end(), _S_word_bit, false);
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ std::vector<bool> y(_S_word_bit, false);
+ x.insert(x.end(), y.begin(), y.end());
+ check_cap_ge_size(x);
+ }
+ catch(std::bad_alloc&)
+ { }
+ catch(std::exception&)
+ { ++myexit; }
+
+ // Attempts to put in more than max_size() items should result in a
+ // length error.
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ for(int i = 0; i < _S_word_bit + 1; ++i)
+ x.push_back(false);
+ ++myexit;
+ }
+ catch(std::bad_alloc)
+ { }
+ catch(std::length_error)
+ { }
+ catch(std::exception)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ x.insert(x.end(), _S_word_bit + 1, false);
+ ++myexit;
+ }
+ catch(std::bad_alloc)
+ { }
+ catch(std::length_error)
+ { }
+ catch(std::exception)
+ { ++myexit; }
+
+ try
+ {
+ std::vector<bool> x;
+ x.resize(x.max_size() - _S_word_bit, false);
+ std::vector<bool> y(_S_word_bit + 1, false);
+ x.insert(x.end(), y.begin(), y.end());
+ ++myexit;
+ }
+ catch(std::bad_alloc)
+ { }
+ catch(std::length_error)
+ { }
+ catch(std::exception)
+ { ++myexit; }
+
+ VERIFY( !myexit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/1.cc
new file mode 100644
index 000000000..7998412ec
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/1.cc
@@ -0,0 +1,145 @@
+// 2005-12-23 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool>::swap
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+// uneq_allocator as a non-empty allocator.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ typedef __gnu_test::uneq_allocator<bool> my_alloc;
+ typedef vector<bool, my_alloc> my_vector;
+
+ const char title01[] = "Rivers of sand";
+ const char title02[] = "Concret PH";
+ const char title03[] = "Sonatas and Interludes for Prepared Piano";
+ const char title04[] = "never as tired as when i'm waking up";
+
+ const size_t N1 = sizeof(title01);
+ const size_t N2 = sizeof(title02);
+ const size_t N3 = sizeof(title03);
+ const size_t N4 = sizeof(title04);
+
+ vector<bool> vec01_ref;
+ for (size_t i = 0; i < N1; ++i)
+ vec01_ref.push_back(bool(title01[i] > 96 ? 1 : 0));
+ vector<bool> vec02_ref;
+ for (size_t i = 0; i < N2; ++i)
+ vec02_ref.push_back(bool(title02[i] > 96 ? 1 : 0));
+ vector<bool> vec03_ref;
+ for (size_t i = 0; i < N3; ++i)
+ vec03_ref.push_back(bool(title03[i] > 96 ? 1 : 0));
+ vector<bool> vec04_ref;
+ for (size_t i = 0; i < N4; ++i)
+ vec04_ref.push_back(bool(title04[i] > 96 ? 1 : 0));
+
+ my_vector::size_type size01, size02;
+
+ my_alloc alloc01(1);
+
+ my_vector vec01(alloc01);
+ size01 = vec01.size();
+ my_vector vec02(alloc01);
+ size02 = vec02.size();
+
+ vec01.swap(vec02);
+ VERIFY( vec01.size() == size02 );
+ VERIFY( vec01.empty() );
+ VERIFY( vec02.size() == size01 );
+ VERIFY( vec02.empty() );
+
+ my_vector vec03(alloc01);
+ size01 = vec03.size();
+ my_vector vec04(vec02_ref.begin(), vec02_ref.end(), alloc01);
+ size02 = vec04.size();
+
+ vec03.swap(vec04);
+ VERIFY( vec03.size() == size02 );
+ VERIFY( equal(vec03.begin(), vec03.end(), vec02_ref.begin()) );
+ VERIFY( vec04.size() == size01 );
+ VERIFY( vec04.empty() );
+
+ my_vector vec05(vec01_ref.begin(), vec01_ref.end(), alloc01);
+ size01 = vec05.size();
+ my_vector vec06(vec02_ref.begin(), vec02_ref.end(), alloc01);
+ size02 = vec06.size();
+
+ vec05.swap(vec06);
+ VERIFY( vec05.size() == size02 );
+ VERIFY( equal(vec05.begin(), vec05.end(), vec02_ref.begin()) );
+ VERIFY( vec06.size() == size01 );
+ VERIFY( equal(vec06.begin(), vec06.end(), vec01_ref.begin()) );
+
+ my_vector vec07(vec01_ref.begin(), vec01_ref.end(), alloc01);
+ size01 = vec07.size();
+ my_vector vec08(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size02 = vec08.size();
+
+ vec07.swap(vec08);
+ VERIFY( vec07.size() == size02 );
+ VERIFY( equal(vec07.begin(), vec07.end(), vec03_ref.begin()) );
+ VERIFY( vec08.size() == size01 );
+ VERIFY( equal(vec08.begin(), vec08.end(), vec01_ref.begin()) );
+
+ my_vector vec09(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size01 = vec09.size();
+ my_vector vec10(vec04_ref.begin(), vec04_ref.end(), alloc01);
+ size02 = vec10.size();
+
+ vec09.swap(vec10);
+ VERIFY( vec09.size() == size02 );
+ VERIFY( equal(vec09.begin(), vec09.end(), vec04_ref.begin()) );
+ VERIFY( vec10.size() == size01 );
+ VERIFY( equal(vec10.begin(), vec10.end(), vec03_ref.begin()) );
+
+ my_vector vec11(vec04_ref.begin(), vec04_ref.end(), alloc01);
+ size01 = vec11.size();
+ my_vector vec12(vec01_ref.begin(), vec01_ref.end(), alloc01);
+ size02 = vec12.size();
+
+ vec11.swap(vec12);
+ VERIFY( vec11.size() == size02 );
+ VERIFY( equal(vec11.begin(), vec11.end(), vec01_ref.begin()) );
+ VERIFY( vec12.size() == size01 );
+ VERIFY( equal(vec12.begin(), vec12.end(), vec04_ref.begin()) );
+
+ my_vector vec13(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size01 = vec13.size();
+ my_vector vec14(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size02 = vec14.size();
+
+ vec13.swap(vec14);
+ VERIFY( vec13.size() == size02 );
+ VERIFY( equal(vec13.begin(), vec13.end(), vec03_ref.begin()) );
+ VERIFY( vec14.size() == size01 );
+ VERIFY( equal(vec14.begin(), vec14.end(), vec03_ref.begin()) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/2.cc
new file mode 100644
index 000000000..55ac925d6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/swap/2.cc
@@ -0,0 +1,174 @@
+// 2005-12-23 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.5 vector<bool>::swap
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+// uneq_allocator, two different personalities.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ typedef __gnu_test::uneq_allocator<bool> my_alloc;
+ typedef vector<bool, my_alloc> my_vector;
+
+ const char title01[] = "Rivers of sand";
+ const char title02[] = "Concret PH";
+ const char title03[] = "Sonatas and Interludes for Prepared Piano";
+ const char title04[] = "never as tired as when i'm waking up";
+
+ const size_t N1 = sizeof(title01);
+ const size_t N2 = sizeof(title02);
+ const size_t N3 = sizeof(title03);
+ const size_t N4 = sizeof(title04);
+
+ vector<bool> vec01_ref;
+ for (size_t i = 0; i < N1; ++i)
+ vec01_ref.push_back(bool(title01[i] > 96 ? 1 : 0));
+ vector<bool> vec02_ref;
+ for (size_t i = 0; i < N2; ++i)
+ vec02_ref.push_back(bool(title02[i] > 96 ? 1 : 0));
+ vector<bool> vec03_ref;
+ for (size_t i = 0; i < N3; ++i)
+ vec03_ref.push_back(bool(title03[i] > 96 ? 1 : 0));
+ vector<bool> vec04_ref;
+ for (size_t i = 0; i < N4; ++i)
+ vec04_ref.push_back(bool(title04[i] > 96 ? 1 : 0));
+
+ my_vector::size_type size01, size02;
+
+ my_alloc alloc01(1), alloc02(2);
+ int personality01, personality02;
+
+ my_vector vec01(alloc01);
+ size01 = vec01.size();
+ personality01 = vec01.get_allocator().get_personality();
+ my_vector vec02(alloc02);
+ size02 = vec02.size();
+ personality02 = vec02.get_allocator().get_personality();
+
+ vec01.swap(vec02);
+ VERIFY( vec01.size() == size02 );
+ VERIFY( vec01.empty() );
+ VERIFY( vec02.size() == size01 );
+ VERIFY( vec02.empty() );
+ VERIFY( vec01.get_allocator().get_personality() == personality02 );
+ VERIFY( vec02.get_allocator().get_personality() == personality01 );
+
+ my_vector vec03(alloc02);
+ size01 = vec03.size();
+ personality01 = vec03.get_allocator().get_personality();
+ my_vector vec04(vec02_ref.begin(), vec02_ref.end(), alloc01);
+ size02 = vec04.size();
+ personality02 = vec04.get_allocator().get_personality();
+
+ vec03.swap(vec04);
+ VERIFY( vec03.size() == size02 );
+ VERIFY( equal(vec03.begin(), vec03.end(), vec02_ref.begin()) );
+ VERIFY( vec04.size() == size01 );
+ VERIFY( vec04.empty() );
+ VERIFY( vec03.get_allocator().get_personality() == personality02 );
+ VERIFY( vec04.get_allocator().get_personality() == personality01 );
+
+ my_vector vec05(vec01_ref.begin(), vec01_ref.end(), alloc01);
+ size01 = vec05.size();
+ personality01 = vec05.get_allocator().get_personality();
+ my_vector vec06(vec02_ref.begin(), vec02_ref.end(), alloc02);
+ size02 = vec06.size();
+ personality02 = vec06.get_allocator().get_personality();
+
+ vec05.swap(vec06);
+ VERIFY( vec05.size() == size02 );
+ VERIFY( equal(vec05.begin(), vec05.end(), vec02_ref.begin()) );
+ VERIFY( vec06.size() == size01 );
+ VERIFY( equal(vec06.begin(), vec06.end(), vec01_ref.begin()) );
+ VERIFY( vec05.get_allocator().get_personality() == personality02 );
+ VERIFY( vec06.get_allocator().get_personality() == personality01 );
+
+ my_vector vec07(vec01_ref.begin(), vec01_ref.end(), alloc02);
+ size01 = vec07.size();
+ personality01 = vec07.get_allocator().get_personality();
+ my_vector vec08(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size02 = vec08.size();
+ personality02 = vec08.get_allocator().get_personality();
+
+ vec07.swap(vec08);
+ VERIFY( vec07.size() == size02 );
+ VERIFY( equal(vec07.begin(), vec07.end(), vec03_ref.begin()) );
+ VERIFY( vec08.size() == size01 );
+ VERIFY( equal(vec08.begin(), vec08.end(), vec01_ref.begin()) );
+ VERIFY( vec07.get_allocator().get_personality() == personality02 );
+ VERIFY( vec08.get_allocator().get_personality() == personality01 );
+
+ my_vector vec09(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size01 = vec09.size();
+ personality01 = vec09.get_allocator().get_personality();
+ my_vector vec10(vec04_ref.begin(), vec04_ref.end(), alloc02);
+ size02 = vec10.size();
+ personality02 = vec10.get_allocator().get_personality();
+
+ vec09.swap(vec10);
+ VERIFY( vec09.size() == size02 );
+ VERIFY( equal(vec09.begin(), vec09.end(), vec04_ref.begin()) );
+ VERIFY( vec10.size() == size01 );
+ VERIFY( equal(vec10.begin(), vec10.end(), vec03_ref.begin()) );
+ VERIFY( vec09.get_allocator().get_personality() == personality02 );
+ VERIFY( vec10.get_allocator().get_personality() == personality01 );
+
+ my_vector vec11(vec04_ref.begin(), vec04_ref.end(), alloc02);
+ size01 = vec11.size();
+ personality01 = vec11.get_allocator().get_personality();
+ my_vector vec12(vec01_ref.begin(), vec01_ref.end(), alloc01);
+ size02 = vec12.size();
+ personality02 = vec12.get_allocator().get_personality();
+
+ vec11.swap(vec12);
+ VERIFY( vec11.size() == size02 );
+ VERIFY( equal(vec11.begin(), vec11.end(), vec01_ref.begin()) );
+ VERIFY( vec12.size() == size01 );
+ VERIFY( equal(vec12.begin(), vec12.end(), vec04_ref.begin()) );
+ VERIFY( vec11.get_allocator().get_personality() == personality02 );
+ VERIFY( vec12.get_allocator().get_personality() == personality01 );
+
+ my_vector vec13(vec03_ref.begin(), vec03_ref.end(), alloc01);
+ size01 = vec13.size();
+ personality01 = vec13.get_allocator().get_personality();
+ my_vector vec14(vec03_ref.begin(), vec03_ref.end(), alloc02);
+ size02 = vec14.size();
+ personality02 = vec14.get_allocator().get_personality();
+
+ vec13.swap(vec14);
+ VERIFY( vec13.size() == size02 );
+ VERIFY( equal(vec13.begin(), vec13.end(), vec03_ref.begin()) );
+ VERIFY( vec14.size() == size01 );
+ VERIFY( equal(vec14.begin(), vec14.end(), vec03_ref.begin()) );
+ VERIFY( vec13.get_allocator().get_personality() == personality02 );
+ VERIFY( vec14.get_allocator().get_personality() == personality01 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc
new file mode 100644
index 000000000..81f228ba6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2007-10-15 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_containers.h>
+
+int main()
+{
+ typedef std::vector<bool> test_type;
+ __gnu_test::citerator<test_type> test;
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc
new file mode 100644
index 000000000..0239d416f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc
@@ -0,0 +1,27 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+#include <vector>
+
+void f()
+{
+ std::vector<bool> vb(10, 1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/swap.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/swap.cc
new file mode 100644
index 000000000..b4139feb6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/bool/swap.cc
@@ -0,0 +1,59 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+template<class Cont>
+ void
+ my_reverse(Cont& c)
+ {
+ for (std::size_t i = 0, j = c.size(); i < j; ++i)
+ {
+ --j;
+ using std::swap;
+ swap(c[i], c[j]);
+ }
+ }
+
+template<class Cont>
+ void
+ my_compare(const Cont& c1, const Cont& c2)
+ {
+ bool test __attribute__((unused)) = true;
+
+ VERIFY( c1.size() == c2.size() );
+
+ for (std::size_t i = 0; i < c1.size(); ++i)
+ VERIFY( c1[i] == c2[c1.size() - i - 1] );
+ }
+
+void test01()
+{
+ const std::vector<bool> vb_ref{0, 1, 1, 0, 1};
+ std::vector<bool> vb(vb_ref);
+ my_reverse(vb);
+ my_compare(vb_ref, vb);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/1.cc
new file mode 100644
index 000000000..736e596b3
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/1.cc
@@ -0,0 +1,60 @@
+// 1999-05-07
+// bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+template<typename T>
+ struct A { };
+
+struct B { };
+
+void test01()
+{
+ // non POD types
+ bool test __attribute__((unused)) = true;
+ std::vector< A<B> > vec01;
+ typedef std::vector< A<B> >::size_type size_type;
+
+ size_type sz01 = vec01.capacity();
+ vec01.reserve(100);
+ size_type sz02 = vec01.capacity();
+ VERIFY( sz02 >= sz01 );
+
+ sz01 = vec01.size() + 5;
+ vec01.resize(sz01);
+ sz02 = vec01.size();
+ VERIFY( sz01 == sz02 );
+
+ sz01 = vec01.size() - 5;
+ vec01.resize(sz01);
+ sz02 = vec01.size();
+ VERIFY( sz01 == sz02 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/2.cc
new file mode 100644
index 000000000..d9b216285
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/2.cc
@@ -0,0 +1,102 @@
+// 1999-05-07
+// bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+using __gnu_test::copy_tracker;
+using __gnu_test::tracker_allocator_counter;
+using __gnu_test::tracker_allocator;
+using __gnu_test::copy_constructor;
+using __gnu_test::assignment_operator;
+using __gnu_test::destructor;
+
+// Verifies basic functionality of reserve() with forced reallocation.
+void
+test_reserve()
+{
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(3);
+ const X::size_type old_size = a.size();
+ const X::size_type old_capacity = a.capacity();
+ const X::size_type new_capacity = old_capacity + 10;
+ T::reset();
+
+ a.reserve(new_capacity);
+
+ // [23.2.4.1 (2)]
+ VERIFY(new_capacity <= a.capacity());
+ // [23.2.4.1 (3)]
+ VERIFY(old_size == a.size());
+ VERIFY(copy_constructor::count() <= old_size);
+ VERIFY(destructor::count() <= old_size);
+ }
+ // check for memory leaks
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+}
+
+// Verifies that reserve() with reallocation offers the strong
+// exception guarantee.
+void
+test_reserve_exception_guarantee()
+{
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ const X::size_type old_size __attribute__((unused)) = a.size();
+ const X::size_type old_capacity = a.capacity();
+ const X::size_type new_capacity = old_capacity + 10;
+ T::reset();
+ copy_constructor::throw_on(3);
+
+ try
+ {
+ a.reserve(new_capacity);
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+
+ VERIFY(old_capacity == a.capacity());
+ VERIFY(copy_constructor::count() == destructor::count()+1);
+ }
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+}
+
+int main()
+{
+ test_reserve();
+ test_reserve_exception_guarantee();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134-2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134-2.cc
new file mode 100644
index 000000000..7f4dd852f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134-2.cc
@@ -0,0 +1,50 @@
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity [lib.vector.capacity]
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+// libstdc++/29134
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ vector<int> v;
+
+ try
+ {
+ v.resize(size_t(-1));
+ }
+ catch(const std::length_error&)
+ {
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134.cc
new file mode 100644
index 000000000..ecaedcbe7
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/29134.cc
@@ -0,0 +1,37 @@
+// Copyright (C) 2006-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity [lib.vector.capacity]
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// libstdc++/29134
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int> v;
+
+ VERIFY( v.max_size() == v.get_allocator().max_size() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/44190.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/44190.cc
new file mode 100644
index 000000000..58115542e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/44190.cc
@@ -0,0 +1,38 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// libstdc++/44190
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int> v;
+ v.resize(10);
+ VERIFY( v.size() <= v.capacity() );
+}
+
+int main()
+{
+
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/8230.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/8230.cc
new file mode 100644
index 000000000..78258ed0e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/8230.cc
@@ -0,0 +1,77 @@
+// 1999-05-07
+// bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+// libstdc++/8230
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ {
+ std::vector<int> array;
+ const std::size_t size = array.max_size();
+ try
+ {
+ array.reserve(size);
+ }
+ catch (const std::length_error& error)
+ {
+ test &= false;
+ }
+ catch (const std::bad_alloc& error)
+ {
+ test &= true;
+ }
+ catch (...)
+ {
+ test &= false;
+ }
+ VERIFY( test );
+ }
+
+ {
+ std::vector<int> array;
+ const std::size_t size = array.max_size() + 1;
+ try
+ {
+ array.reserve(size);
+ }
+ catch (const std::length_error& error)
+ {
+ test &= true;
+ }
+ catch (...)
+ {
+ test &= false;
+ }
+ VERIFY( test );
+ }
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable.cc
new file mode 100644
index 000000000..0ed52eb9b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable.cc
@@ -0,0 +1,47 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2007-10-28 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace __gnu_test;
+
+ std::vector<copycounter> a(40);
+ copycounter::copycount = 0;
+
+ a.reserve(50);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.reserve(200);
+ VERIFY( copycounter::copycount == 0 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable2.cc
new file mode 100644
index 000000000..171ee2c26
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/reserve/moveable2.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-06-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace __gnu_test;
+
+ std::vector<throwing_move_constructor> v(5);
+
+ v.reserve(50);
+ VERIFY( v.capacity() >= 50 );
+
+ v.reserve(500);
+ VERIFY( v.capacity() >= 500 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/1.cc
new file mode 100644
index 000000000..4a7ff0417
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/1.cc
@@ -0,0 +1,55 @@
+// 1999-05-07
+// bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.2 vector capacity
+
+// This fails on some versions of Darwin 8 because malloc doesn't return
+// NULL even if an allocation fails (filed as Radar 3884894).
+// { dg-do run { xfail *-*-darwin8.[0-4].* } }
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::vector<int> v;
+ try
+ {
+ v.resize(v.max_size());
+ v[v.max_size() - 1] = 2002;
+ }
+ catch (const std::bad_alloc& error)
+ {
+ test = true;
+ }
+ catch (...)
+ {
+ test = false;
+ }
+ VERIFY( test );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable.cc
new file mode 100644
index 000000000..e8d67b52f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable.cc
@@ -0,0 +1,55 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+using namespace __gnu_test;
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<copycounter> a;
+ copycounter::copycount = 0;
+ a.resize(10);
+ a.resize(98);
+ a.resize(99);
+ a.resize(100);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.resize(99);
+ a.resize(0);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.resize(100);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.clear();
+ VERIFY( copycounter::copycount == 0 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable2.cc
new file mode 100644
index 000000000..dd9547b60
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/moveable2.cc
@@ -0,0 +1,57 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-06-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace __gnu_test;
+
+ std::vector<throwing_move_constructor> v(5);
+
+ v.resize(50);
+ VERIFY( v.size() == 50 );
+
+ v.reserve(200);
+ VERIFY( v.capacity() >= 200 );
+
+ v.resize(100);
+ VERIFY( v.size() == 100 );
+
+ v.resize(500, throwing_move_constructor());
+ VERIFY( v.size() == 500 );
+
+ v.reserve(2000);
+ VERIFY( v.capacity() >= 2000 );
+
+ v.resize(1000, throwing_move_constructor());
+ VERIFY( v.size() == 1000 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/resize_size.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/resize_size.cc
new file mode 100644
index 000000000..a02ef24a7
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/resize/resize_size.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<__gnu_test::NonCopyConstructible> v;
+ VERIFY( std::distance(v.begin(), v.end()) == 0 );
+
+ v.resize(1000);
+ VERIFY( std::distance(v.begin(), v.end()) == 1000 );
+ for(auto it = v.begin(); it != v.end(); ++it)
+ VERIFY( *it == -1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc
new file mode 100644
index 000000000..5e228781a
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc
@@ -0,0 +1,42 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-01-08 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// libstdc++/42573
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int> v(100);
+ v.push_back(1);
+ v.push_back(1);
+ VERIFY( v.size() < v.capacity() );
+ v.shrink_to_fit();
+ VERIFY( v.size() == v.capacity() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit2.cc
new file mode 100644
index 000000000..b099117ea
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit2.cc
@@ -0,0 +1,61 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+using __gnu_test::propagating_allocator;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef propagating_allocator<int, true> alloc_type;
+ alloc_type alloc(5);
+
+ std::vector<int, alloc_type> v(10u, 1, alloc);
+ v.reserve(100);
+ VERIFY( v.size() < v.capacity() );
+ v.shrink_to_fit();
+ VERIFY( v.size() == v.capacity() );
+ VERIFY( v.get_allocator().get_personality() == alloc.get_personality() );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef propagating_allocator<int, false> alloc_type;
+ alloc_type alloc(5);
+
+ std::vector<int, alloc_type> v(10u, 1, alloc);
+ v.reserve(100);
+ VERIFY( v.size() < v.capacity() );
+ v.shrink_to_fit();
+ VERIFY( v.size() == v.capacity() );
+ VERIFY( v.get_allocator().get_personality() == alloc.get_personality() );
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
new file mode 100644
index 000000000..580c8c93c
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc
@@ -0,0 +1,76 @@
+// 2004-07-26 Matt Austern <austern@apple.com>
+//
+// Copyright (C) 2003-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+
+#include <vector>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::vector<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c;
+ ok = check_construct_destroy("empty container", 0, 0) && ok;
+ }
+ ok = check_construct_destroy("empty container", 0, 0) && ok;
+
+
+ tracker_allocator_counter::reset();
+ {
+ Container c(arr10, arr10 + 10);
+ ok = check_construct_destroy("Construct from range", 10, 0) && ok;
+ }
+ ok = check_construct_destroy("Construct from range", 10, 10) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ c.reserve(100);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin(), arr10[0]);
+ ok = check_construct_destroy("Insert element", 1, 0) && ok;
+ }
+ ok = check_construct_destroy("Insert element", 1, 11) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ c.reserve(100);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 5, arr10, arr10+3);
+ ok = check_construct_destroy("Insert short range", 3, 0) && ok;
+ }
+ ok = check_construct_destroy("Insert short range", 3, 13) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ c.reserve(100);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, arr10, arr10+10);
+ ok = check_construct_destroy("Insert long range", 10, 0) && ok;
+ }
+ ok = check_construct_destroy("Insert long range", 10, 20) && ok;
+
+ return ok ? 0 : 1;
+}
+
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/1.cc
new file mode 100644
index 000000000..8395e0a63
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/1.cc
@@ -0,0 +1,46 @@
+// 1999-06-29 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.1 vector constructors, copy, and assignment
+
+#include <vector>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+template<typename T>
+ struct A { };
+
+struct B { };
+
+void test01()
+{
+ // 1
+ std::vector< A<B> > vec01;
+ std::vector< A<B> > vec02(5);
+ typedef std::vector< A<B> >::size_type size_type;
+
+ vec01 = vec02;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/2.cc
new file mode 100644
index 000000000..379e879cd
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/2.cc
@@ -0,0 +1,47 @@
+// 1999-06-29 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.1 vector constructors, copy, and assignment
+
+#include <vector>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+template<typename T>
+ struct A { };
+
+struct B { };
+
+// 2
+template class std::vector<double>;
+template class std::vector< A<B> >;
+
+// libstdc++/102
+void test02()
+{
+ std::vector<int> v1;
+ std::vector<int> v2(v1);
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/3.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/3.cc
new file mode 100644
index 000000000..c9749eba7
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/3.cc
@@ -0,0 +1,52 @@
+// 1999-06-29 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.1 vector constructors, copy, and assignment
+
+#include <vector>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+// test range constructors and range-fill constructor
+void
+test03()
+{
+ bool test __attribute__((unused)) = true;
+ const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
+ const int B[] = {7, 7, 7, 7, 7};
+ const int N = sizeof(A) / sizeof(int);
+ const int M = sizeof(B) / sizeof(int);
+
+ std::vector<int> v3(A, A + N);
+ VERIFY(std::equal(v3.begin(), v3.end(), A));
+
+ std::vector<int> v4(v3.begin(), v3.end());
+ VERIFY(std::equal(v4.begin(), v4.end(), A));
+
+ std::vector<int> v5(M, 7);
+ VERIFY(std::equal(v5.begin(), v5.end(), B));
+ VERIFY(std::equal(B, B + M, v5.begin()));
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/4.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/4.cc
new file mode 100644
index 000000000..a6dc04640
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/4.cc
@@ -0,0 +1,584 @@
+// 1999-06-29 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.1 vector constructors, copy, and assignment
+
+#include <vector>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+using __gnu_test::copy_tracker;
+using __gnu_test::tracker_allocator_counter;
+using __gnu_test::tracker_allocator;
+using __gnu_test::copy_constructor;
+using __gnu_test::assignment_operator;
+
+// @fn test_default_ctor_exception_gurantee This test verifies that if
+// one of the vector's contained objects throws an exception from its
+// constructor while the vector is being constructed and filled with
+// default values, all memory is returned to the allocator whence it
+// came.
+void
+test_default_ctor_exception_gurantee()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ copy_tracker::reset();
+ copy_constructor::throw_on(3);
+ tracker_allocator_counter::reset();
+
+ // run test
+ try
+ {
+ T ref;
+ X a(7, ref);
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+
+ // assert postconditions
+ VERIFY( tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count() );
+
+ // teardown
+}
+
+// @fn test_copy_ctor_exception_gurantee This test verifies that if
+// one of the vector's contained objects throws an exception from its
+// constructor while the vector is being copy constructed, all memory
+// is returned to the allocator whence it came.
+void
+test_copy_ctor_exception_gurantee()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ copy_tracker::reset();
+ copy_constructor::throw_on(3);
+
+ // run test
+ try
+ {
+ X u(a);
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+ }
+
+ // assert postconditions
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+// operator=()
+//
+// case 1: lhs.size() > rhs.size()
+// case 2: lhs.size() < rhs.size() < lhs.capacity()
+// case 3: lhs.capacity() < rhs.size()
+//
+void
+test_assignment_operator_1()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X r(9);
+ X a(r.size() - 2);
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // preconditions
+ VERIFY(r.size() > a.size());
+
+ // run test
+ r = a;
+
+ // assert postconditions
+ VERIFY(r == a);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_assignment_operator_2()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X r(1);
+ r.reserve(17);
+ X a(r.size() + 7);
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // preconditions
+ VERIFY(r.size() < a.size());
+ VERIFY(a.size() < r.capacity());
+
+ // run test
+ r = a;
+
+ // assert postconditions
+ VERIFY(r == a);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_assignment_operator_3()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X r(1);
+ X a(r.capacity() + 7);
+ copy_tracker::reset();
+
+ // preconditions
+ VERIFY(r.capacity() < a.size());
+
+ // run test
+ r = a;
+
+ // assert postconditions
+ VERIFY(r == a);
+ }
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_assignment_operator_3_exception_guarantee()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X r(1);
+ X a(r.capacity() + 7);
+ copy_tracker::reset();
+ copy_constructor::throw_on(3);
+
+ // preconditions
+ VERIFY(r.capacity() < a.size());
+
+ // run test
+ try
+ {
+ r = a;
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+ }
+
+ // assert postconditions
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+// fill assign()
+//
+// case 1: [23.2.4.1 (3)] n <= size()
+// case 2: [23.2.4.1 (3)] size() < n <= capacity()
+// case 3: [23.2.4.1 (3)] n > capacity()
+// case 4: [23.2.4.1 (3)] n > capacity(), exception guarantees
+// case 5: [23.1.1 (9)] fill assign disguised as a range assign
+//
+void
+test_fill_assign_1()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X a(7);
+ X::size_type old_size = a.size();
+ X::size_type new_size = old_size - 2;
+ const T t;
+
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // run test
+ a.assign(new_size, t);
+
+ // assert postconditions
+ VERIFY(a.size() == new_size);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_fill_assign_2()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X a(7);
+ a.reserve(11);
+ X::size_type old_size = a.size();
+ X::size_type old_capacity = a.capacity();
+ X::size_type new_size = old_size + 2;
+ const T t;
+
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // assert preconditions
+ VERIFY(old_size < new_size);
+ VERIFY(new_size <= old_capacity);
+
+ // run test
+ a.assign(new_size, t);
+
+ // assert postconditions
+ VERIFY(a.size() == new_size);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_fill_assign_3()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ X::size_type old_capacity = a.capacity();
+ X::size_type new_size = old_capacity + 4;
+ const T t;
+
+ copy_tracker::reset();
+
+ // assert preconditions
+ VERIFY(new_size > old_capacity);
+
+ // run test
+ a.assign(new_size, t);
+
+ // assert postconditions
+ VERIFY(a.size() == new_size);
+ }
+
+ VERIFY(tracker_allocator_counter::get_allocation_count() > 0);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_fill_assign_3_exception_guarantee()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ X::size_type old_size = a.size();
+ X::size_type old_capacity = a.capacity();
+ X::size_type new_size = old_capacity + 4;
+ const T t;
+
+ copy_tracker::reset();
+ copy_constructor::throw_on(3);
+
+ // assert preconditions
+ VERIFY(new_size > old_capacity);
+
+ // run test
+ try
+ {
+ a.assign(new_size, t);
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+
+ // assert postconditions
+ VERIFY(a.size() == old_size);
+ VERIFY(a.capacity() == old_capacity);
+ }
+
+ VERIFY(tracker_allocator_counter::get_allocation_count() > 0);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_fill_assign_4()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X a(7);
+ X::size_type old_size = a.size();
+ X::size_type new_size = old_size - 2;
+ X::size_type new_value = 117;
+
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // run test
+ a.assign(new_size, new_value);
+
+ // assert postconditions
+ VERIFY(a.size() == new_size);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+// range assign()
+//
+// case 1: [23.2.4.1 (2)] input iterator
+// case 2: [23.2.4.1 (2)] forward iterator, distance(first, last) <= size()
+// case 3: [23.2.4.1 (2)]
+// forward iterator, size() < distance(first, last) <= capacity()
+// case 4: [23.2.4.1 (2)] forward iterator, distance(first, last) > capacity()
+// case 5: [23.2.4.1 (2)]
+// forward iterator, distance(first, last) > capacity(),
+// exception guarantees
+void
+test_range_assign_1()
+{
+ // @TODO
+}
+
+void
+test_range_assign_2()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X a(7);
+ X b(3);
+
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // assert preconditions
+ VERIFY(b.size() < a.capacity());
+
+ // run test
+ a.assign(b.begin(), b.end());
+
+ // assert postconditions
+ VERIFY(a.size() == b.size());
+ VERIFY(a == b);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_range_assign_3()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ X a(7);
+ a.reserve(a.size() + 7);
+ X b(a.size() + 3);
+
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+
+ // assert preconditions
+ VERIFY(a.size() < b.size());
+ VERIFY(b.size() < a.capacity());
+
+ // run test
+ a.assign(b.begin(), b.end());
+
+ // assert postconditions
+ VERIFY(a.size() == b.size());
+ VERIFY(a == b);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == 0);
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_range_assign_4()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ X b(a.capacity() + 7);
+
+ copy_tracker::reset();
+
+ // assert preconditions
+ VERIFY(b.size() > a.capacity());
+
+ // run test
+ a.assign(b.begin(), b.end());
+
+ // assert postconditions
+ VERIFY(a.size() == b.size());
+ VERIFY(a == b);
+ }
+ VERIFY(tracker_allocator_counter::get_allocation_count() > 0);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+void
+test_range_assign_4_exception_guarantee()
+{
+ // setup
+ bool test __attribute__((unused)) = true;
+ typedef copy_tracker T;
+ typedef std::vector<T, tracker_allocator<T> > X;
+
+ tracker_allocator_counter::reset();
+ {
+ X a(7);
+ X b(a.capacity() + 7);
+
+ copy_tracker::reset();
+ copy_constructor::throw_on(3);
+
+ // assert preconditions
+ VERIFY(b.size() > a.capacity());
+
+ // run test
+ try
+ {
+ a.assign(b.begin(), b.end());
+ VERIFY(false);
+ }
+ catch (...)
+ {
+ }
+ }
+
+ // assert postconditions
+ VERIFY(tracker_allocator_counter::get_allocation_count() > 0);
+ VERIFY(tracker_allocator_counter::get_allocation_count() == tracker_allocator_counter::get_deallocation_count());
+
+ // teardown
+ copy_tracker::reset();
+ tracker_allocator_counter::reset();
+}
+
+
+int main()
+{
+ test_default_ctor_exception_gurantee();
+ test_copy_ctor_exception_gurantee();
+ test_assignment_operator_1();
+ test_assignment_operator_2();
+ test_assignment_operator_3();
+ test_assignment_operator_3_exception_guarantee();
+ test_fill_assign_1();
+ test_fill_assign_2();
+ test_fill_assign_3();
+ test_fill_assign_3_exception_guarantee();
+ test_fill_assign_4();
+ test_range_assign_1();
+ test_range_assign_2();
+ test_range_assign_3();
+ test_range_assign_4();
+ test_range_assign_4_exception_guarantee();
+
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/6513.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/6513.cc
new file mode 100644
index 000000000..9af310050
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/6513.cc
@@ -0,0 +1,38 @@
+// 1999-06-29 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.1 vector constructors, copy, and assignment
+
+#include <vector>
+#include <string>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+
+// libstdc++/6513
+void test04()
+{
+ const char* c_strings[5] = { "1", "2", "3", "4", "5" };
+ std::vector<std::string> strings(c_strings, c_strings + 5);
+}
+
+int main()
+{
+ test04();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/clear_allocator.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/clear_allocator.cc
new file mode 100644
index 000000000..7f01bb67d
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/clear_allocator.cc
@@ -0,0 +1,87 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <ext/new_allocator.h>
+
+using namespace std;
+using __gnu_cxx::new_allocator;
+
+template<typename T>
+ class clear_alloc : public new_allocator<T>
+ {
+ public:
+
+ template <typename T1>
+ struct rebind
+ { typedef clear_alloc<T1> other; };
+
+ virtual void clear() throw()
+ { }
+
+ clear_alloc() throw()
+ { }
+
+ clear_alloc(clear_alloc const&) throw() : new_allocator<T>()
+ { }
+
+ template<typename T1>
+ clear_alloc(clear_alloc<T1> const&) throw()
+ { }
+
+ virtual ~clear_alloc() throw()
+ { this->clear(); }
+
+ T* allocate(typename new_allocator<T>::size_type n, const void *hint = 0)
+ {
+ this->clear();
+ return new_allocator<T>::allocate(n, hint);
+ }
+
+ void deallocate(T *ptr, typename new_allocator<T>::size_type n)
+ {
+ this->clear();
+ new_allocator<T>::deallocate(ptr, n);
+ }
+ };
+
+template<typename Container>
+ void Check_Container()
+ {
+ Container* pic = new Container;
+ int x = 230;
+
+ while (x--)
+ {
+ pic->push_back(x);
+ }
+
+ pic->get_allocator();
+
+ // The following has led to infinite recursions or cores.
+ pic->clear();
+
+ delete pic;
+ }
+
+
+int main()
+{
+ Check_Container<std::vector<int, clear_alloc<int> > >();
+ return 0;
+}
+
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/cons_size.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/cons_size.cc
new file mode 100644
index 000000000..6f9d2b6ac
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/cons_size.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2010-06-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<__gnu_test::NonCopyConstructible> v(1000);
+ VERIFY( std::distance(v.begin(), v.end()) == 1000 );
+ for(auto it = v.begin(); it != v.end(); ++it)
+ VERIFY( *it == -1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable.cc
new file mode 100644
index 000000000..51fe36034
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable.cc
@@ -0,0 +1,62 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on vector (via swap). If the implementation changed
+// this test may begin to fail.
+
+#include <vector>
+#include <utility>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int> a,b;
+ a.push_back(1);
+ b = std::move(a);
+ VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+
+ std::vector<int> c(std::move(b));
+ VERIFY( c.size() == 1 && c[0] == 1 );
+ VERIFY( b.size() == 0 );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<bool> a,b;
+ a.push_back(1);
+ b = std::move(a);
+ VERIFY( b.size() == 1 && b[0] == 1 && a.size() == 0 );
+
+ std::vector<bool> c(std::move(b));
+ VERIFY( c.size() == 1 && c[0] == 1 );
+ VERIFY( b.size() == 0 );
+}
+
+int main(void)
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc
new file mode 100644
index 000000000..5e3903a4b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/moveable2.cc
@@ -0,0 +1,55 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <iterator>
+#include <testsuite_iterators.h>
+#include <testsuite_rvalref.h>
+
+using namespace __gnu_test;
+typedef std::vector<rvalstruct> test_type;
+
+// Empty constructor doesn't require a copy constructor
+void
+test01()
+{ test_type d; }
+
+// Constructing from a range that returns rvalue references doesn't
+// require a copy constructor.
+void
+test02(rvalstruct* begin, rvalstruct* end)
+{
+ test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Constructing from a input iterator range that returns rvalue
+// references doesn't require a copy constructor either.
+void
+test03(input_iterator_wrapper<rvalstruct> begin,
+ input_iterator_wrapper<rvalstruct> end)
+{
+ test_type d(std::make_move_iterator(begin), std::make_move_iterator(end));
+}
+
+// Neither does destroying one.
+void
+test04(test_type* d)
+{ delete d; }
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/noexcept_move_construct.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/noexcept_move_construct.cc
new file mode 100644
index 000000000..3376a3c62
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/cons/noexcept_move_construct.cc
@@ -0,0 +1,27 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// 2011-06-01 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+typedef std::vector<int> vtype;
+
+static_assert(std::is_nothrow_move_constructible<vtype>::value, "Error");
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/data_access/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/data_access/1.cc
new file mode 100644
index 000000000..915d0a904
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/data_access/1.cc
@@ -0,0 +1,50 @@
+// 2005-08-29 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// libstdc++/23578
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::vector<int> vector_type;
+
+ {
+ const int A[] = { 0, 1, 2, 3, 4 };
+ vector_type v(A, A + 5);
+ VERIFY( v.data() == &v.front() );
+ int* pi = v.data();
+ VERIFY( *pi == 0 );
+ }
+
+ {
+ const int A[] = { 4, 3, 2, 1, 0 };
+ const vector_type cv(A, A + 5);
+ VERIFY( cv.data() == &cv.front() );
+ const int* pci = cv.data();
+ VERIFY( *pci == 4 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc
new file mode 100644
index 000000000..0e466b229
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc
@@ -0,0 +1,43 @@
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// PR libstdc++/52433
+
+#include <vector>
+
+struct X
+{
+ std::vector<int>::iterator i;
+
+ X() = default;
+ X(const X&) = default;
+ X(X&&) = default;
+ X& operator=(const X&) = default;
+ X& operator=(X&&) = default;
+};
+
+X test01()
+{
+ X x;
+ x = X();
+ return x;
+}
+
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/alloc_prop.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/alloc_prop.cc
new file mode 100644
index 000000000..1283af67b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/alloc_prop.cc
@@ -0,0 +1,89 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-do compile }
+// { dg-options "-std=gnu++11" }
+
+#include <debug/vector>
+#include <type_traits>
+#include <testsuite_allocator.h>
+
+template<typename T, typename A>
+ void
+ test()
+ {
+ typedef std::vector<T, A> base;
+ typedef __gnu_debug::vector<T, A> debug;
+
+ using std::is_nothrow_default_constructible;
+ using std::is_nothrow_copy_constructible;
+ using std::is_nothrow_move_constructible;
+ using std::is_nothrow_copy_assignable;
+ using std::is_nothrow_move_assignable;
+
+ static_assert(
+ is_nothrow_default_constructible<base>::value
+ == is_nothrow_default_constructible<debug>::value,
+ "nothrow default constructible");
+
+ static_assert(
+ is_nothrow_copy_constructible<base>::value
+ == is_nothrow_copy_constructible<debug>::value,
+ "nothrow copy constructible");
+
+ static_assert(
+ is_nothrow_move_constructible<base>::value
+ == is_nothrow_move_constructible<debug>::value,
+ "nothrow move constructible");
+
+ static_assert(
+ is_nothrow_copy_assignable<base>::value
+ == is_nothrow_copy_assignable<debug>::value,
+ "nothrow move assignable");
+
+ static_assert(
+ is_nothrow_move_assignable<base>::value
+ == is_nothrow_move_assignable<debug>::value,
+ "nothrow move assignable");
+ }
+
+struct X
+{
+ X() { }
+ ~X() { }
+ X(const X&) { }
+ X(X&&) { }
+ X& operator=(const X&) { return *this; }
+ X& operator=(X&&) { return *this; }
+};
+
+int main()
+{
+ using __gnu_test::propagating_allocator;
+ using __gnu_test::SimpleAllocator;
+
+ test<int, std::allocator<int>>();
+ test<int, SimpleAllocator<int>>();
+ test<int, propagating_allocator<int, true>>();
+ test<int, propagating_allocator<int, false>>();
+ test<X, std::allocator<X>>();
+ test<X, SimpleAllocator<X>>();
+ test<X, propagating_allocator<X, true>>();
+ test<X, propagating_allocator<X, false>>();
+
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc
new file mode 100644
index 000000000..9e828c3ae
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign1_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_assign1<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc
new file mode 100644
index 000000000..98e45415f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign2_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_assign2<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc
new file mode 100644
index 000000000..2feb4a2e1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign3_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_assign3<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc
new file mode 100644
index 000000000..67d94ff6a
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/assign4_neg.cc
@@ -0,0 +1,32 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-do run { xfail *-*-* } }
+
+#include <debug/vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_assign1<__gnu_debug::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/bool/shrink_to_fit.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/bool/shrink_to_fit.cc
new file mode 100644
index 000000000..a10562f45
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/bool/shrink_to_fit.cc
@@ -0,0 +1,42 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+
+void test01()
+{
+ using std::vector;
+
+ vector<bool> vb(__CHAR_BIT__ * sizeof(unsigned long) + 1);
+ vb.pop_back();
+
+ vector<bool>::iterator it = vb.begin();
+ vb.shrink_to_fit();
+
+ // Following line should assert
+ *it = true;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc
new file mode 100644
index 000000000..243b30fd5
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct1_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_construct1<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc
new file mode 100644
index 000000000..ba4ea07a1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct2_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_construct2<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc
new file mode 100644
index 000000000..bfae13881
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct3_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_construct3<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc
new file mode 100644
index 000000000..30e47480e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/construct4_neg.cc
@@ -0,0 +1,32 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-do run { xfail *-*-* } }
+
+#include <debug/vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_construct1<__gnu_debug::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc
new file mode 100644
index 000000000..814aa1c58
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert1_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_insert1<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc
new file mode 100644
index 000000000..850a74c05
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert2_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_insert2<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc
new file mode 100644
index 000000000..58216ebb5
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert3_neg.cc
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_insert3<std::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc
new file mode 100644
index 000000000..c22dd06f1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/insert4_neg.cc
@@ -0,0 +1,32 @@
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-do run { xfail *-*-* } }
+
+#include <debug/vector>
+#include <debug/checks.h>
+
+void test01()
+{
+ __gnu_test::check_insert1<__gnu_debug::vector<int> >();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc
new file mode 100644
index 000000000..2fb628226
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/1.cc
@@ -0,0 +1,59 @@
+// Vector iterator invalidation tests
+
+// Copyright (C) 2003-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// We need to be pedantic about reallocations for this testcase to be correct.
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#ifndef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDANTIC 1
+#endif
+
+#include <debug/vector>
+#include <testsuite_hooks.h>
+
+using __gnu_debug::vector;
+
+bool test = true;
+
+// Assignment
+void test01()
+{
+ vector<int> v1;
+ vector<int> v2;
+
+ vector<int>::iterator i = v1.end();
+ VERIFY(!i._M_dereferenceable() && !i._M_singular());
+
+ v1 = v2;
+ VERIFY(i._M_singular());
+
+ i = v1.end();
+ v1.assign(v2.begin(), v2.end());
+ VERIFY(i._M_singular());
+
+ i = v1.end();
+ v1.assign(17, 42);
+ VERIFY(i._M_singular());
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc
new file mode 100644
index 000000000..242943e67
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/2.cc
@@ -0,0 +1,64 @@
+// Vector iterator invalidation tests
+
+// Copyright (C) 2003-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// We need to be pedantic about reallocations for this testcase to be correct.
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#ifndef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDANTIC 1
+#endif
+
+#include <debug/vector>
+#include <testsuite_hooks.h>
+
+using __gnu_debug::vector;
+
+bool test = true;
+
+// Resize
+void test02()
+{
+ vector<int> v(10, 17);
+ v.reserve(20);
+
+ vector<int>::iterator before = v.begin() + 6;
+ vector<int>::iterator at = before + 1;
+ vector<int>::iterator after = at + 1;
+
+ // Shrink
+ v.resize(7);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_singular());
+ VERIFY(after._M_singular());
+
+ // Grow, without reallocation
+ before = v.begin() + 6;
+ v.resize(17);
+ VERIFY(before._M_dereferenceable());
+
+ // Grow, with reallocation
+ v.resize(42);
+ VERIFY(before._M_singular());
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc
new file mode 100644
index 000000000..a826c7eb6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/3.cc
@@ -0,0 +1,89 @@
+// Vector iterator invalidation tests
+
+// Copyright (C) 2003-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// We need to be pedantic about reallocations for this testcase to be correct.
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#ifndef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDANTIC 1
+#endif
+
+#include <debug/vector>
+#include <testsuite_hooks.h>
+
+using __gnu_debug::vector;
+
+bool test = true;
+
+// Insert
+void test03()
+{
+ vector<int> v(10, 17);
+ v.reserve(30);
+
+ // Insert a single element
+ vector<int>::iterator before = v.begin() + 6;
+ vector<int>::iterator at = before + 1;
+ vector<int>::iterator after = at;
+ at = v.insert(at, 42);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_dereferenceable());
+ VERIFY(after._M_singular());
+
+ // Insert multiple copies
+ before = v.begin() + 6;
+ at = before + 1;
+ v.insert(at, 3, 42);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_singular());
+
+ // Insert iterator range
+ static int data[] = { 2, 3, 5, 7 };
+ before = v.begin() + 6;
+ at = before + 1;
+ v.insert(at, &data[0], &data[0] + 4);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_singular());
+
+ // Insert with reallocation
+ before = v.begin() + 6;
+ at = before + 1;
+ v.insert(at, 30, 17);
+ VERIFY(before._M_singular());
+ VERIFY(at._M_singular());
+
+ // Single insert with reallocation
+ vector<int> v2;
+ v2.reserve(100);
+ at = v2.begin();
+ v2.insert(at, 100, 17);
+ at = v2.end() - 1;
+ before = v2.begin();
+ VERIFY(at._M_dereferenceable());
+ VERIFY(before._M_dereferenceable());
+ at = v2.insert(at, 42);
+ VERIFY(at._M_dereferenceable());
+ VERIFY(before._M_singular());
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc
new file mode 100644
index 000000000..55dca5369
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/invalidation/4.cc
@@ -0,0 +1,66 @@
+// Vector iterator invalidation tests
+
+// Copyright (C) 2003-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// We need to be pedantic about reallocations for this testcase to be correct.
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#ifndef _GLIBCXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDANTIC 1
+#endif
+
+#include <debug/vector>
+#include <testsuite_hooks.h>
+
+using __gnu_debug::vector;
+
+bool test = true;
+
+// Erase
+void test04()
+{
+ vector<int> v(20, 42);
+
+ // Single element erase
+ vector<int>::iterator before = v.begin();
+ vector<int>::iterator at = before + 3;
+ vector<int>::iterator after = at;
+ at = v.erase(at);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_dereferenceable());
+ VERIFY(after._M_singular());
+
+ // Multiple element erase
+ before = v.begin();
+ at = before + 3;
+ v.erase(at, at + 3);
+ VERIFY(before._M_dereferenceable());
+ VERIFY(at._M_singular());
+
+ // clear()
+ before = v.begin();
+ VERIFY(before._M_dereferenceable());
+ v.clear();
+ VERIFY(before._M_singular());
+}
+
+int main()
+{
+ test04();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/iterator_self_move_assign_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/iterator_self_move_assign_neg.cc
new file mode 100644
index 000000000..ee5213281
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/iterator_self_move_assign_neg.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+
+void test01()
+{
+ std::vector<int> v1;
+ auto it1 = v1.begin();
+ it1 = std::move(it1);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
new file mode 100644
index 000000000..74fd8494f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/multithreaded_swap.cc
@@ -0,0 +1,100 @@
+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* } }
+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* } }
+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-debug-mode "" }
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+
+// This test check for potential deadlock when swaping sequences in debug
+// mode as it requires acquiring 2 locks at the same time.
+
+#include <vector>
+#include <thread>
+#include <functional>
+#include <testsuite_hooks.h>
+
+// The following function mimic the one in src/debug.cc to associate a mutex
+// to a given safe sequence instance.
+size_t
+get_index(std::vector<int>& v)
+{
+ const size_t mask = 0xf;
+ // We have to check the address of the internal safe sequence that starts
+ // after the normal vector memory footprint that is to say a 3 pointers
+ // offset:
+ void* __address = reinterpret_cast<char*>(&v) + 3 * sizeof(void*);
+ return std::_Hash_impl::hash(__address) & mask;
+}
+
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+ vector<int> v1, v2;
+ vector<shared_ptr<vector<int> > > vs;
+ vector<int> *pv3 = 0, *pv4 = 0;
+ const int nb_attempts = 100;
+ for (int i = 0; i != nb_attempts; ++i)
+ {
+ vs.push_back(shared_ptr<vector<int> >(new vector<int>()));
+ if (!pv3)
+ {
+ if (get_index(*vs.back()) == get_index(v1))
+ pv3 = vs.back().get();
+ }
+ else if (!pv4)
+ {
+ if (get_index(*vs.back()) == get_index(v2))
+ {
+ pv4 = vs.back().get();
+ break;
+ }
+ }
+ }
+
+ if (!pv3 || !pv4)
+ // Maybe an other time...
+ return;
+
+ vector<int> &v3 = *pv3, &v4 = *pv4;
+
+ // v1 and v3 shares the same mutex instance, like v2 and v4
+ // thread t1 lock v1 and v2
+ thread t1([&v1, &v2]()
+ {
+ for (int i = 0; i != 1000; ++i)
+ v1.swap(v2);
+ });
+ // thread t2 lock v4 and v3
+ thread t2([&v3, &v4]()
+ {
+ for (int i = 0; i != 1000; ++i)
+ v4.swap(v3);
+ });
+ t2.join();
+ t1.join();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/self_move_assign_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/self_move_assign_neg.cc
new file mode 100644
index 000000000..c59e6a258
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/self_move_assign_neg.cc
@@ -0,0 +1,34 @@
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++11" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+
+void test01()
+{
+ std::vector<int> v1;
+ v1 = std::move(v1);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/shrink_to_fit.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/shrink_to_fit.cc
new file mode 100644
index 000000000..ded73444e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug/shrink_to_fit.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+// { dg-require-debug-mode "" }
+// { dg-options "-std=gnu++0x" }
+// { dg-do run { xfail *-*-* } }
+
+#include <vector>
+
+void test01()
+{
+ using std::vector;
+ vector<int> v;
+ v.reserve(2);
+ v.push_back(0);
+ vector<int>::iterator it = v.begin();
+ v.shrink_to_fit();
+ // Following line should assert
+ *it = 1;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-1.cc
new file mode 100644
index 000000000..1207737c1
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-1.cc
@@ -0,0 +1,50 @@
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// NB: This issue affected only debug-mode.
+
+#include <vector>
+#include <algorithm>
+#include <iterator>
+
+// http://gcc.gnu.org/ml/libstdc++/2008-05/msg00039.html
+void test01()
+{
+ typedef std::vector<unsigned> array_t;
+ typedef std::back_insert_iterator<array_t> bii_t;
+
+ array_t a;
+
+ // Push 5 elements.
+ a.push_back(0);
+ a.push_back(1);
+ a.push_back(2);
+ a.push_back(3);
+ a.push_back(4);
+ // Ensure that there is enough space for other two elements.
+ // (2 + 5 = 7)
+ if (a.capacity() < 7)
+ a.reserve(7);
+ // Add two new elements.
+ std::copy(a.begin(), a.begin() + 2, bii_t(a));
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-2.cc
new file mode 100644
index 000000000..c348aaf08
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/debug_mode_requires_reallocation-2.cc
@@ -0,0 +1,52 @@
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// NB: This issue affected only debug-mode, in pedantic mode.
+
+// { dg-options "-D_GLIBCXX_DEBUG_PEDANTIC" }
+
+#include <vector>
+#include <algorithm>
+#include <iterator>
+
+// http://gcc.gnu.org/ml/libstdc++/2008-05/msg00046.html
+void test01()
+{
+ typedef std::vector<unsigned> array_t;
+ typedef std::back_insert_iterator<array_t> bii_t;
+
+ array_t a;
+
+ // Push 5 elements.
+ a.push_back(0);
+ a.push_back(1);
+ a.push_back(2);
+ a.push_back(3);
+ a.push_back(4);
+ // Ensure that there is enough space for other two elements.
+ // (2 + 5 = 7)
+ if (a.capacity() < 7)
+ a.reserve(7);
+ // Add two new elements.
+ std::copy(a.begin(), a.begin() + 2, bii_t(a));
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/element_access/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/element_access/1.cc
new file mode 100644
index 000000000..24c1f5d12
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/element_access/1.cc
@@ -0,0 +1,61 @@
+// 2000-09-06
+// bkoz
+
+// Copyright (C) 2000-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4 vector
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+template<typename T>
+struct A { };
+
+struct B { };
+
+// http://gcc.gnu.org/ml/libstdc++/2000-09/msg00002.html
+bool test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::vector< A<B> > vec01;
+ std::vector< A<B> > vec02(5);
+ typedef std::vector< A<B> >::size_type size_type;
+ typedef std::vector< A<B> >::reference reference;
+
+ try
+ {
+ reference r01 __attribute__((unused)) = vec01.at(6);
+ VERIFY( false ); // Should not get here, as exception thrown.
+ }
+ catch(std::out_of_range& err)
+ {
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+ return test;
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/citerators.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/citerators.cc
new file mode 100644
index 000000000..aeb6bc5cc
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/citerators.cc
@@ -0,0 +1,45 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+
+// Ensures equivalence of iterators based on low-level comparison
+// between const / non-const Pointer types.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> > v(7);
+ VERIFY( v.cbegin() == v.begin() );
+ VERIFY( v.cend() == v.end() );
+ VERIFY( v.crbegin() == v.rbegin() );
+ VERIFY( v.crend() == v.rend() );
+ VERIFY( v.cbegin() != v.cend() );
+ VERIFY( v.crbegin() != v.crend() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/data_access.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/data_access.cc
new file mode 100644
index 000000000..981da32ce
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/data_access.cc
@@ -0,0 +1,52 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+
+// libstdc++/23578
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ typedef std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> > vector_type;
+
+ {
+ const int A[] = { 0, 1, 2, 3, 4 };
+ vector_type v(A, A + 5);
+ VERIFY( v.data() == &v.front() );
+ int* pi = &* v.data();
+ VERIFY( *pi == 0 );
+ }
+
+ {
+ const int A[] = { 4, 3, 2, 1, 0 };
+ const vector_type cv(A, A + 5);
+ VERIFY( cv.data() == &cv.front() );
+ const int* pci = &* cv.data();
+ VERIFY( *pci == 4 );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/1.cc
new file mode 100644
index 000000000..6a80d0769
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/1.cc
@@ -0,0 +1,26 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <ext/extptr_allocator.h>
+
+// { dg-do compile }
+
+template class std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> >;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc
new file mode 100644
index 000000000..b8bd50732
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc
@@ -0,0 +1,27 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <ext/extptr_allocator.h>
+
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+template class std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> >;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc
new file mode 100644
index 000000000..cbfef4b65
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc
@@ -0,0 +1,27 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <ext/extptr_allocator.h>
+
+// { dg-do compile }
+
+// libstdc++/21770
+template class std::vector<int, __gnu_cxx::_ExtPtr_allocator<char> >;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/element.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/element.cc
new file mode 100644
index 000000000..2ddaaec42
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/element.cc
@@ -0,0 +1,77 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+
+// General tests element access and manipulation
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ int A[] = { 0, 1, 2, 3, 4 };
+ __gnu_cxx::_ExtPtr_allocator<int> alloc;
+ std::vector<int,__gnu_cxx::_ExtPtr_allocator<int> > mv( A, A+5, alloc );
+
+ VERIFY( mv.size() == 5 );
+ VERIFY( mv.front() == 0 );
+ VERIFY( mv.back() == 4 );
+ VERIFY( mv.at(2) == 2 );
+ VERIFY( mv[3] == 3);
+ mv.front() = 5;
+ mv.back() = 6;
+ mv.at(2) = 7;
+ mv[3] = 8;
+ VERIFY( mv.size() == 5 );
+ VERIFY( mv.front() == 5 );
+ VERIFY( mv.back() == 6 );
+ VERIFY( mv.at(2) == 7 );
+ VERIFY( mv[3] == 8 );
+
+ try
+ {
+ mv.at(100) = 8;
+ }
+ catch(std::out_of_range&)
+ {
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+
+ const std::vector<int,__gnu_cxx::_ExtPtr_allocator<int> > cmv( mv );
+ VERIFY( cmv.get_allocator() == mv.get_allocator() );
+ VERIFY( mv.size() == 5 );
+ VERIFY( mv.front() == 5 );
+ VERIFY( mv.back() == 6 );
+ VERIFY( mv.at(2) == 7 );
+ VERIFY( mv[3] == 8 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/erase.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/erase.cc
new file mode 100644
index 000000000..7570b6634
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/erase.cc
@@ -0,0 +1,139 @@
+// Bob Walters 10-2008
+
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+
+const int A[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+const int A1[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+const int A2[] = {0, 2, 3, 4, 10, 11, 12, 13, 14, 15};
+const int A3[] = {0, 2, 3, 4, 10, 11};
+const int A4[] = {4, 10, 11};
+const int A5[] = {4, 10};
+const unsigned int N = sizeof(A) / sizeof(int);
+const unsigned int N1 = sizeof(A1) / sizeof(int);
+const unsigned int N2 = sizeof(A2) / sizeof(int);
+const unsigned int N3 = sizeof(A3) / sizeof(int);
+const unsigned int N4 = sizeof(A4) / sizeof(int);
+const unsigned int N5 = sizeof(A5) / sizeof(int);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<int,__gnu_cxx::_ExtPtr_allocator<int> > vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v(A, A + N);
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), A1) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), A2) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), A3) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), A4) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), A5) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+void
+test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef __gnu_cxx::_ExtPtr_allocator<int> int_alloc_type;
+ typedef __gnu_cxx::_ExtPtr_allocator< std::vector<int, int_alloc_type> > vec_alloc_type;
+ typedef std::vector<std::vector<int, int_alloc_type >,vec_alloc_type> vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v, v1, v2, v3, v4, v5;
+ for (unsigned int i = 0; i < N; ++i)
+ v.push_back(std::vector<int,int_alloc_type>(1, A[i]));
+ for (unsigned int i = 0; i < N1; ++i)
+ v1.push_back(std::vector<int,int_alloc_type>(1, A1[i]));
+ for (unsigned int i = 0; i < N2; ++i)
+ v2.push_back(std::vector<int,int_alloc_type>(1, A2[i]));
+ for (unsigned int i = 0; i < N3; ++i)
+ v3.push_back(std::vector<int,int_alloc_type>(1, A3[i]));
+ for (unsigned int i = 0; i < N4; ++i)
+ v4.push_back(std::vector<int,int_alloc_type>(1, A4[i]));
+ for (unsigned int i = 0; i < N5; ++i)
+ v5.push_back(std::vector<int,int_alloc_type>(1, A5[i]));
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), v1.begin()) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), v2.begin()) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), v3.begin()) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), v4.begin()) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), v5.begin()) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/insert.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/insert.cc
new file mode 100644
index 000000000..d21a9dc3b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/modifiers/insert.cc
@@ -0,0 +1,66 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+#include <stdexcept>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ __gnu_cxx::_ExtPtr_allocator<int> alloc;
+ std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> > iv(alloc);
+ VERIFY( iv.get_allocator() == alloc );
+ VERIFY( iv.size() == 0 );
+
+ int A[] = { 0, 1, 2, 3, 4 };
+ int B[] = { 5, 5, 5, 5, 5 };
+ int C[] = { 6, 7 };
+ iv.insert(iv.end(), A, A+5 );
+ VERIFY( iv.size() == 5 );
+ iv.insert(iv.begin(), 5, 5 );
+ iv.insert(iv.begin()+5, 7);
+ iv.insert(iv.begin()+5, 6);
+ VERIFY( std::equal(iv.begin(), iv.begin()+5, B ));
+ VERIFY( std::equal(iv.begin()+5, iv.begin()+7, C));
+ VERIFY( std::equal(iv.begin()+7, iv.end(), A));
+ VERIFY( iv.size() == 12 );
+
+ try
+ {
+ iv.insert(iv.end(), iv.max_size() + 1, 1);
+ }
+ catch(std::length_error&)
+ {
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/resize.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/resize.cc
new file mode 100644
index 000000000..c761fa0af
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/resize.cc
@@ -0,0 +1,64 @@
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_allocator.h>
+#include <testsuite_hooks.h>
+#include <ext/extptr_allocator.h>
+
+
+void test01()
+{
+ // non POD types
+ bool test __attribute__((unused)) = true;
+
+ std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> > vec01;
+ typedef std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> >::size_type size_type;
+
+ VERIFY(vec01.empty());
+
+ const int A[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+
+ // Test resize of the vector based on reserve
+ size_type sz01 = vec01.capacity();
+ vec01.reserve(100);
+ size_type sz02 = vec01.capacity();
+ VERIFY(sz02 >= sz01);
+
+ // grow/shrink
+ vec01.assign( A, A+10 );
+ sz01 = vec01.size() + 100;
+ vec01.resize(sz01);
+ sz02 = vec01.size();
+ VERIFY(sz01 == sz02);
+ VERIFY(std::equal(vec01.begin(), vec01.begin()+10, A));
+
+ sz01 = vec01.size() - 100;
+ vec01.resize(sz01);
+ sz02 = vec01.size();
+ VERIFY(sz01 == sz02);
+ VERIFY(std::equal(vec01.begin(), vec01.end(), A));
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/1.cc
new file mode 100644
index 000000000..d01d5b7d5
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/1.cc
@@ -0,0 +1,60 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// This is a copy of vector/types/1.cc with altered allocator.
+// The operator+()s in this test initially failed the test -
+// they stress the accurate recognition, by the compiler,
+// of _Pointer_adapter's own pointer arithmetic functions,
+// which have to match perfectly on the int type to get
+// chosen by the compiler when it sees: _Pointer_adapter<T> + int, etc.
+
+#include <vector>
+#include <ext/extptr_allocator.h>
+
+namespace N
+{
+ struct X { };
+
+ template<typename T>
+ X operator+(T, std::size_t)
+ { return X(); }
+
+ template<typename T>
+ X operator-(T, T)
+ { return X(); }
+}
+
+int main()
+{
+ std::vector<N::X, __gnu_cxx::_ExtPtr_allocator<N::X> > v(5);
+ const std::vector<N::X, __gnu_cxx::_ExtPtr_allocator<N::X> > w(1);
+
+ v[0];
+ w[0];
+ v.size();
+ v.capacity();
+ v.resize(1);
+ v.insert(v.begin(), N::X());
+ v.insert(v.begin(), 1, N::X());
+ v.insert(v.begin(), w.begin(), w.end());
+ v = w;
+
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/2.cc
new file mode 100644
index 000000000..27c89ce69
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/types/2.cc
@@ -0,0 +1,62 @@
+// Test for Container using non-standard pointer types.
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// { dg-options "-std=gnu++0x" }
+
+// This is a copy of vector/types/1.cc with altered allocator.
+// The operator+()s in this test initially failed the test -
+// they stress the accurate recognition, by the compiler,
+// of _Pointer_adapter's own pointer arithmetic functions,
+// which have to match perfectly on the int type to get
+// chosen by the compiler when it sees: _Pointer_adapter<T> + int, etc.
+
+#include <vector>
+#include <ext/extptr_allocator.h>
+
+namespace N
+{
+ struct X { };
+
+ template<typename T>
+ X operator+(T, std::size_t)
+ { return X(); }
+
+ template<typename T>
+ X operator-(T, T)
+ { return X(); }
+}
+
+int main()
+{
+ std::vector<N::X, __gnu_cxx::_ExtPtr_allocator<N::X> > v(5);
+ const std::vector<N::X, __gnu_cxx::_ExtPtr_allocator<N::X> > w(1);
+
+ v[0];
+ w[0];
+ v.size();
+ v.capacity();
+ v.resize(1);
+ v.insert(v.begin(), N::X());
+ v.insert(v.begin(), 1, N::X());
+ v.insert(v.begin(), w.begin(), w.end());
+ v = w;
+
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/init-list.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/init-list.cc
new file mode 100644
index 000000000..238af922c
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/init-list.cc
@@ -0,0 +1,60 @@
+// Copyright (C) 2008-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+
+// { dg-options "-std=gnu++0x" }
+
+#include <vector>
+#include <testsuite_allocator.h>
+
+using namespace __gnu_test;
+
+int main()
+{
+ typedef std::vector<int, tracker_allocator<int> > Container;
+ const int arr10[10] = { 2, 4, 1, 7, 3, 8, 10, 5, 9, 6 };
+ bool ok = true;
+
+ tracker_allocator_counter::reset();
+ {
+ Container c({ 2, 4, 1 });
+ ok = check_construct_destroy("Construct from init-list", 3, 0) && ok;
+ ok &= (c[0] == 2);
+ ok &= (c[1] == 4);
+ }
+ ok = check_construct_destroy("Construct from init-list", 3, 3) && ok;
+
+ {
+ Container c(arr10, arr10 + 10);
+ tracker_allocator_counter::reset();
+ c.insert(c.begin() + 7, { 234, 42, 1 });
+ ok = check_construct_destroy("Insert init-list", 13, 10) && ok;
+ ok &= (c[7] == 234);
+ }
+ ok = check_construct_destroy("Insert init-list", 13, 23) && ok;
+
+ {
+ Container c;
+ tracker_allocator_counter::reset();
+ c = { 13, 0, 42 };
+ ok = check_construct_destroy("Assign init-list", 3, 0) && ok;
+ ok &= (c[0] == 13);
+ }
+ ok = check_construct_destroy("Assign init-list", 3, 3) && ok;
+
+ return ok ? 0 : 1;;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/1.cc
new file mode 100644
index 000000000..52e1dace7
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/1.cc
@@ -0,0 +1,55 @@
+// 1999-11-09 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.3 vector modifiers
+
+#include <vector>
+#include "testsuite_hooks.h"
+
+bool test __attribute__((unused)) = true;
+
+template<typename T>
+ struct A { };
+
+struct B { };
+
+// vector::insert(iterator, inputiterator first, inputiterator last)
+void
+test01()
+{
+ // POD types
+ typedef std::vector<int> vec_POD;
+ vec_POD vec01;
+ int i01 = 5;
+ int* pi01 = &i01;
+ vec01.insert(vec01.begin(), pi01, pi01 + 1);
+
+ // non POD types
+ typedef std::vector< A<B> > vec_nonPOD;
+ vec_nonPOD vec02;
+ A<B> np01;
+ A<B>* pnp01 = &np01;
+ vec02.insert(vec02.begin(), pnp01, pnp01 + 1);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/2.cc
new file mode 100644
index 000000000..2cc378cb2
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/2.cc
@@ -0,0 +1,61 @@
+// 1999-11-09 bkoz
+
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.3 vector modifiers
+
+#include <vector>
+#include "testsuite_hooks.h"
+
+bool test __attribute__((unused)) = true;
+
+// test the assign() function
+void
+test03()
+{
+ const int K = 417;
+ const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17};
+ const int B[] = {K, K, K, K, K};
+ const std::size_t N = sizeof(A) / sizeof(int);
+ const std::size_t M = sizeof(B) / sizeof(int);
+ bool test __attribute__((unused)) = true;
+
+ // assign from pointer range
+ std::vector<int> v3;
+ v3.assign(A, A + N);
+ VERIFY(std::equal(v3.begin(), v3.end(), A));
+ VERIFY(v3.size() == N);
+
+ // assign from iterator range
+ std::vector<int> v4;
+ v4.assign(v3.begin(), v3.end());
+ VERIFY(std::equal(v4.begin(), v4.end(), A));
+ VERIFY(std::equal(A, A + N, v4.begin()));
+
+ // assign from initializer range with resize
+ v4.assign(M, K);
+ VERIFY(std::equal(v4.begin(), v4.end(), B));
+ VERIFY(std::equal(B, B + M, v4.begin()));
+ VERIFY((v4.size() == M) && (M != N));
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc
new file mode 100644
index 000000000..893134c68
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc
@@ -0,0 +1,28 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+// libstdc++/52799
+int main()
+{
+ std::vector<int> v;
+ v.emplace(v.begin());
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/1.cc
new file mode 100644
index 000000000..aa31cb41f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/1.cc
@@ -0,0 +1,135 @@
+// 2005-11-02 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.3 vector modifiers
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+const int A[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+const int A1[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
+const int A2[] = {0, 2, 3, 4, 10, 11, 12, 13, 14, 15};
+const int A3[] = {0, 2, 3, 4, 10, 11};
+const int A4[] = {4, 10, 11};
+const int A5[] = {4, 10};
+const unsigned int N = sizeof(A) / sizeof(int);
+const unsigned int N1 = sizeof(A1) / sizeof(int);
+const unsigned int N2 = sizeof(A2) / sizeof(int);
+const unsigned int N3 = sizeof(A3) / sizeof(int);
+const unsigned int N4 = sizeof(A4) / sizeof(int);
+const unsigned int N5 = sizeof(A5) / sizeof(int);
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<int> vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v(A, A + N);
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), A1) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), A2) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), A3) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), A4) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), A5) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+void
+test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ typedef std::vector<std::vector<int> > vec_type;
+ typedef vec_type::iterator iterator_type;
+
+ vec_type v, v1, v2, v3, v4, v5;
+ for (unsigned int i = 0; i < N; ++i)
+ v.push_back(std::vector<int>(1, A[i]));
+ for (unsigned int i = 0; i < N1; ++i)
+ v1.push_back(std::vector<int>(1, A1[i]));
+ for (unsigned int i = 0; i < N2; ++i)
+ v2.push_back(std::vector<int>(1, A2[i]));
+ for (unsigned int i = 0; i < N3; ++i)
+ v3.push_back(std::vector<int>(1, A3[i]));
+ for (unsigned int i = 0; i < N4; ++i)
+ v4.push_back(std::vector<int>(1, A4[i]));
+ for (unsigned int i = 0; i < N5; ++i)
+ v5.push_back(std::vector<int>(1, A5[i]));
+
+ iterator_type it1 = v.erase(v.begin() + 1);
+ VERIFY( it1 == v.begin() + 1 );
+ VERIFY( v.size() == N1 );
+ VERIFY( std::equal(v.begin(), v.end(), v1.begin()) );
+
+ iterator_type it2 = v.erase(v.begin() + 4, v.begin() + 9);
+ VERIFY( it2 == v.begin() + 4 );
+ VERIFY( v.size() == N2 );
+ VERIFY( std::equal(v.begin(), v.end(), v2.begin()) );
+
+ iterator_type it3 = v.erase(v.begin() + 6, v.end());
+ VERIFY( it3 == v.begin() + 6 );
+ VERIFY( v.size() == N3 );
+ VERIFY( std::equal(v.begin(), v.end(), v3.begin()) );
+
+ iterator_type it4 = v.erase(v.begin(), v.begin() + 3);
+ VERIFY( it4 == v.begin() );
+ VERIFY( v.size() == N4 );
+ VERIFY( std::equal(v.begin(), v.end(), v4.begin()) );
+
+ iterator_type it5 = v.erase(v.begin() + 2);
+ VERIFY( it5 == v.begin() + 2 );
+ VERIFY( v.size() == N5 );
+ VERIFY( std::equal(v.begin(), v.end(), v5.begin()) );
+
+ iterator_type it6 = v.erase(v.begin(), v.end());
+ VERIFY( it6 == v.begin() );
+ VERIFY( v.empty() );
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc
new file mode 100644
index 000000000..0f84ecfd6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/50529.cc
@@ -0,0 +1,38 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-09-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_rvalref.h>
+
+// libstdc++/50529
+void test01()
+{
+ std::vector<__gnu_test::rvalstruct> v(10);
+
+ for (auto it = v.begin(); it != v.end(); ++it)
+ v.erase(it, it);
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/moveable.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/moveable.cc
new file mode 100644
index 000000000..c857913f9
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/erase/moveable.cc
@@ -0,0 +1,62 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2007-10-28 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace __gnu_test;
+
+ std::vector<copycounter> a(40);
+ copycounter::copycount = 0;
+
+ a.erase(a.begin() + 20);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.begin());
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.end() - 1);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.begin() + 10, a.end() - 10);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.begin(), a.begin() + 5);
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.end() - 5, a.end());
+ VERIFY( copycounter::copycount == 0 );
+
+ a.erase(a.begin(), a.end());
+ VERIFY( copycounter::copycount == 0 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/1.cc
new file mode 100644
index 000000000..0305a8ec6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/1.cc
@@ -0,0 +1,49 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ vector<int> iv;
+
+ try
+ {
+ iv.insert(iv.end(), iv.max_size() + 1, 1);
+ }
+ catch(std::length_error&)
+ {
+ VERIFY( true );
+ }
+ catch(...)
+ {
+ VERIFY( false );
+ }
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable.cc
new file mode 100644
index 000000000..3216b6459
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable.cc
@@ -0,0 +1,137 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+using namespace __gnu_test;
+
+// Test vector::push_back makes no unneeded copies.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<copycounter> a;
+ copycounter c(1);
+ copycounter::copycount = 0;
+ for(int i = 0; i < 10; ++i)
+ a.push_back(c);
+ VERIFY(copycounter::copycount == 10);
+
+ for(int i = 0; i < 100; ++i)
+ a.insert(a.begin() + i, c);
+ VERIFY(copycounter::copycount == 110);
+
+ for(int i = 0; i < 1000; ++i)
+ a.insert(a.end(), c);
+ VERIFY(copycounter::copycount == 1110);
+}
+
+// Test vector::insert(iterator, iterator, iterator) makes no unneeded copies
+// when it has to also reallocate the vector's internal buffer.
+void
+test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ copycounter c(1);
+ std::vector<copycounter> a(10, c), b(100, c);
+ copycounter::copycount = 0;
+ a.insert(a.begin(), b.begin(), b.begin() + 20);
+ VERIFY(copycounter::copycount == 20);
+ a.insert(a.end(), b.begin(), b.begin() + 50);
+ VERIFY(copycounter::copycount == 70);
+ a.insert(a.begin() + 50, b.begin(), b.end());
+ VERIFY(copycounter::copycount == 170);
+}
+
+// Test vector::insert(iterator, iterator, iterator) makes no unneeded copies
+// when it doesn't have to reallocate the vector's internal buffer.
+void
+test03()
+{
+ bool test __attribute__((unused)) = true;
+
+ copycounter c(1);
+ std::vector<copycounter> a(10, c), b(100, c);
+ copycounter::copycount = 0;
+ a.reserve(1000);
+ VERIFY(copycounter::copycount == 0);
+ a.insert(a.begin(), b.begin(), b.begin() + 20);
+ VERIFY(copycounter::copycount == 20);
+ a.insert(a.end(), b.begin(), b.begin() + 50);
+ VERIFY(copycounter::copycount == 70);
+ a.insert(a.begin() + 50, b.begin(), b.end());
+ VERIFY(copycounter::copycount == 170);
+}
+
+// Test vector::insert(iterator, count, value) makes no unneeded copies
+// when it has to also reallocate the vector's internal buffer.
+void
+test04()
+{
+ bool test __attribute__((unused)) = true;
+
+ copycounter c(1);
+ std::vector<copycounter> a(10, c);
+ copycounter::copycount = 0;
+ a.insert(a.begin(), 20, c);
+ VERIFY(copycounter::copycount == 20);
+ a.insert(a.end(), 50, c);
+ VERIFY(copycounter::copycount == 70);
+ a.insert(a.begin() + 50, 100, c);
+ VERIFY(copycounter::copycount == 170);
+}
+
+// Test vector::insert(iterator, count, value) makes no unneeded copies
+// when it doesn't have to reallocate the vector's internal buffer.
+void
+test05()
+{
+ bool test __attribute__((unused)) = true;
+
+ copycounter c(1);
+ std::vector<copycounter> a(10, c);
+ copycounter::copycount = 0;
+ a.reserve(1000);
+ a.insert(a.begin(), 20, c);
+ // NOTE : These values are each one higher than might be expected, as
+ // vector::insert(iterator, count, value) copies the value it is given
+ // when it doesn't reallocate the buffer.
+ VERIFY(copycounter::copycount == 20 + 1);
+ a.insert(a.end(), 50, c);
+ VERIFY(copycounter::copycount == 70 + 2);
+ a.insert(a.begin() + 50, 100, c);
+ VERIFY(copycounter::copycount == 170 + 3);
+}
+
+
+
+int main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ test05();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable2.cc
new file mode 100644
index 000000000..b05d4d0ff
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/moveable2.cc
@@ -0,0 +1,77 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2011-06-07 Paolo Carlini <paolo.carlini@oracle.com>
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_rvalref.h>
+
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace __gnu_test;
+
+ std::vector<throwing_move_constructor> v1;
+
+ throwing_move_constructor tmc;
+
+ v1.push_back(tmc);
+ VERIFY( v1.size() == 1 );
+
+ v1.push_back(tmc);
+ VERIFY( v1.size() == 2 );
+
+ v1.insert(v1.end(), tmc);
+ VERIFY( v1.size() == 3 );
+
+ v1.insert(v1.end(), 100, tmc);
+ VERIFY( v1.size() == 103 );
+
+ v1.insert(v1.end(), 10, tmc);
+ VERIFY( v1.size() == 113 );
+
+ v1.insert(v1.end(), 1, tmc);
+ VERIFY( v1.size() == 114 );
+
+ std::vector<throwing_move_constructor> v2;
+
+ throwing_move_constructor tmca[]
+ = { throwing_move_constructor(), throwing_move_constructor(),
+ throwing_move_constructor(), throwing_move_constructor() };
+
+ v2.insert(v2.end(), tmca, tmca + 1);
+ VERIFY( v2.size() == 1 );
+
+ v2.insert(v2.end(), tmca, tmca + 4);
+ VERIFY( v2.size() == 5 );
+
+ v2.insert(v2.end(), tmca, tmca + 2);
+ VERIFY( v2.size() == 7 );
+
+ v2.insert(v2.end(), tmca, tmca + 1);
+ VERIFY( v2.size() == 8 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc
new file mode 100644
index 000000000..c28104a3f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/push_back/49836.cc
@@ -0,0 +1,50 @@
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2011-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_tr1.h>
+
+// libstdc++/49836
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using __gnu_test::CopyConsOnlyType;
+ using __gnu_test::MoveConsOnlyType;
+
+ std::vector<CopyConsOnlyType> v1;
+ CopyConsOnlyType t1(1);
+ v1.push_back(t1);
+ v1.push_back(t1);
+ v1.push_back(t1);
+ VERIFY( v1.size() == 3 );
+
+ std::vector<MoveConsOnlyType> v2;
+ MoveConsOnlyType t2(1);
+ v2.push_back(std::move(t2));
+ v2.push_back(std::move(t2));
+ v2.push_back(std::move(t2));
+ VERIFY( v2.size() == 3 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/1.cc
new file mode 100644
index 000000000..9d9f76d2c
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/1.cc
@@ -0,0 +1,62 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+struct T { int i; };
+
+int swap_calls;
+
+namespace std
+{
+ template<>
+ void
+ vector<T, allocator<T> >::swap(vector<T, allocator<T> >&)
+ { ++swap_calls; }
+}
+
+// Should use vector specialization for swap.
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ std::vector<T> A;
+ std::vector<T> B;
+ swap_calls = 0;
+ std::swap(A, B);
+ VERIFY(1 == swap_calls);
+}
+
+// Should use vector specialization for swap.
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+ vector<T> A;
+ vector<T> B;
+ swap_calls = 0;
+ swap(A, B);
+ VERIFY(1 == swap_calls);
+}
+
+// See c++/13658 for background info.
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/2.cc
new file mode 100644
index 000000000..0361568e6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/2.cc
@@ -0,0 +1,132 @@
+// 2005-12-20 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.3 vector::swap
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+// uneq_allocator as a non-empty allocator.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ typedef __gnu_test::uneq_allocator<char> my_alloc;
+ typedef vector<char, my_alloc> my_vector;
+
+ const char title01[] = "Rivers of sand";
+ const char title02[] = "Concret PH";
+ const char title03[] = "Sonatas and Interludes for Prepared Piano";
+ const char title04[] = "never as tired as when i'm waking up";
+
+ const size_t N1 = sizeof(title01);
+ const size_t N2 = sizeof(title02);
+ const size_t N3 = sizeof(title03);
+ const size_t N4 = sizeof(title04);
+
+ my_vector::size_type size01, size02;
+
+ my_alloc alloc01(1);
+
+ my_vector vec01(alloc01);
+ size01 = vec01.size();
+ my_vector vec02(alloc01);
+ size02 = vec02.size();
+
+ vec01.swap(vec02);
+ VERIFY( vec01.size() == size02 );
+ VERIFY( vec01.empty() );
+ VERIFY( vec02.size() == size01 );
+ VERIFY( vec02.empty() );
+
+ my_vector vec03(alloc01);
+ size01 = vec03.size();
+ my_vector vec04(title02, title02 + N2, alloc01);
+ size02 = vec04.size();
+
+ vec03.swap(vec04);
+ VERIFY( vec03.size() == size02 );
+ VERIFY( equal(vec03.begin(), vec03.end(), title02) );
+ VERIFY( vec04.size() == size01 );
+ VERIFY( vec04.empty() );
+
+ my_vector vec05(title01, title01 + N1, alloc01);
+ size01 = vec05.size();
+ my_vector vec06(title02, title02 + N2, alloc01);
+ size02 = vec06.size();
+
+ vec05.swap(vec06);
+ VERIFY( vec05.size() == size02 );
+ VERIFY( equal(vec05.begin(), vec05.end(), title02) );
+ VERIFY( vec06.size() == size01 );
+ VERIFY( equal(vec06.begin(), vec06.end(), title01) );
+
+ my_vector vec07(title01, title01 + N1, alloc01);
+ size01 = vec07.size();
+ my_vector vec08(title03, title03 + N3, alloc01);
+ size02 = vec08.size();
+
+ vec07.swap(vec08);
+ VERIFY( vec07.size() == size02 );
+ VERIFY( equal(vec07.begin(), vec07.end(), title03) );
+ VERIFY( vec08.size() == size01 );
+ VERIFY( equal(vec08.begin(), vec08.end(), title01) );
+
+ my_vector vec09(title03, title03 + N3, alloc01);
+ size01 = vec09.size();
+ my_vector vec10(title04, title04 + N4, alloc01);
+ size02 = vec10.size();
+
+ vec09.swap(vec10);
+ VERIFY( vec09.size() == size02 );
+ VERIFY( equal(vec09.begin(), vec09.end(), title04) );
+ VERIFY( vec10.size() == size01 );
+ VERIFY( equal(vec10.begin(), vec10.end(), title03) );
+
+ my_vector vec11(title04, title04 + N4, alloc01);
+ size01 = vec11.size();
+ my_vector vec12(title01, title01 + N1, alloc01);
+ size02 = vec12.size();
+
+ vec11.swap(vec12);
+ VERIFY( vec11.size() == size02 );
+ VERIFY( equal(vec11.begin(), vec11.end(), title01) );
+ VERIFY( vec12.size() == size01 );
+ VERIFY( equal(vec12.begin(), vec12.end(), title04) );
+
+ my_vector vec13(title03, title03 + N3, alloc01);
+ size01 = vec13.size();
+ my_vector vec14(title03, title03 + N3, alloc01);
+ size02 = vec14.size();
+
+ vec13.swap(vec14);
+ VERIFY( vec13.size() == size02 );
+ VERIFY( equal(vec13.begin(), vec13.end(), title03) );
+ VERIFY( vec14.size() == size01 );
+ VERIFY( equal(vec14.begin(), vec14.end(), title03) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/3.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/3.cc
new file mode 100644
index 000000000..3f258e0a3
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap/3.cc
@@ -0,0 +1,161 @@
+// 2005-12-20 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.4.3 vector::swap
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+// uneq_allocator, two different personalities.
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ typedef __gnu_test::uneq_allocator<char> my_alloc;
+ typedef vector<char, my_alloc> my_vector;
+
+ const char title01[] = "Rivers of sand";
+ const char title02[] = "Concret PH";
+ const char title03[] = "Sonatas and Interludes for Prepared Piano";
+ const char title04[] = "never as tired as when i'm waking up";
+
+ const size_t N1 = sizeof(title01);
+ const size_t N2 = sizeof(title02);
+ const size_t N3 = sizeof(title03);
+ const size_t N4 = sizeof(title04);
+
+ my_vector::size_type size01, size02;
+
+ my_alloc alloc01(1), alloc02(2);
+ int personality01, personality02;
+
+ my_vector vec01(alloc01);
+ size01 = vec01.size();
+ personality01 = vec01.get_allocator().get_personality();
+ my_vector vec02(alloc02);
+ size02 = vec02.size();
+ personality02 = vec02.get_allocator().get_personality();
+
+ vec01.swap(vec02);
+ VERIFY( vec01.size() == size02 );
+ VERIFY( vec01.empty() );
+ VERIFY( vec02.size() == size01 );
+ VERIFY( vec02.empty() );
+ VERIFY( vec01.get_allocator().get_personality() == personality02 );
+ VERIFY( vec02.get_allocator().get_personality() == personality01 );
+
+ my_vector vec03(alloc02);
+ size01 = vec03.size();
+ personality01 = vec03.get_allocator().get_personality();
+ my_vector vec04(title02, title02 + N2, alloc01);
+ size02 = vec04.size();
+ personality02 = vec04.get_allocator().get_personality();
+
+ vec03.swap(vec04);
+ VERIFY( vec03.size() == size02 );
+ VERIFY( equal(vec03.begin(), vec03.end(), title02) );
+ VERIFY( vec04.size() == size01 );
+ VERIFY( vec04.empty() );
+ VERIFY( vec03.get_allocator().get_personality() == personality02 );
+ VERIFY( vec04.get_allocator().get_personality() == personality01 );
+
+ my_vector vec05(title01, title01 + N1, alloc01);
+ size01 = vec05.size();
+ personality01 = vec05.get_allocator().get_personality();
+ my_vector vec06(title02, title02 + N2, alloc02);
+ size02 = vec06.size();
+ personality02 = vec06.get_allocator().get_personality();
+
+ vec05.swap(vec06);
+ VERIFY( vec05.size() == size02 );
+ VERIFY( equal(vec05.begin(), vec05.end(), title02) );
+ VERIFY( vec06.size() == size01 );
+ VERIFY( equal(vec06.begin(), vec06.end(), title01) );
+ VERIFY( vec05.get_allocator().get_personality() == personality02 );
+ VERIFY( vec06.get_allocator().get_personality() == personality01 );
+
+ my_vector vec07(title01, title01 + N1, alloc02);
+ size01 = vec07.size();
+ personality01 = vec07.get_allocator().get_personality();
+ my_vector vec08(title03, title03 + N3, alloc01);
+ size02 = vec08.size();
+ personality02 = vec08.get_allocator().get_personality();
+
+ vec07.swap(vec08);
+ VERIFY( vec07.size() == size02 );
+ VERIFY( equal(vec07.begin(), vec07.end(), title03) );
+ VERIFY( vec08.size() == size01 );
+ VERIFY( equal(vec08.begin(), vec08.end(), title01) );
+ VERIFY( vec07.get_allocator().get_personality() == personality02 );
+ VERIFY( vec08.get_allocator().get_personality() == personality01 );
+
+ my_vector vec09(title03, title03 + N3, alloc01);
+ size01 = vec09.size();
+ personality01 = vec09.get_allocator().get_personality();
+ my_vector vec10(title04, title04 + N4, alloc02);
+ size02 = vec10.size();
+ personality02 = vec10.get_allocator().get_personality();
+
+ vec09.swap(vec10);
+ VERIFY( vec09.size() == size02 );
+ VERIFY( equal(vec09.begin(), vec09.end(), title04) );
+ VERIFY( vec10.size() == size01 );
+ VERIFY( equal(vec10.begin(), vec10.end(), title03) );
+ VERIFY( vec09.get_allocator().get_personality() == personality02 );
+ VERIFY( vec10.get_allocator().get_personality() == personality01 );
+
+ my_vector vec11(title04, title04 + N4, alloc02);
+ size01 = vec11.size();
+ personality01 = vec11.get_allocator().get_personality();
+ my_vector vec12(title01, title01 + N1, alloc01);
+ size02 = vec12.size();
+ personality02 = vec12.get_allocator().get_personality();
+
+ vec11.swap(vec12);
+ VERIFY( vec11.size() == size02 );
+ VERIFY( equal(vec11.begin(), vec11.end(), title01) );
+ VERIFY( vec12.size() == size01 );
+ VERIFY( equal(vec12.begin(), vec12.end(), title04) );
+ VERIFY( vec11.get_allocator().get_personality() == personality02 );
+ VERIFY( vec12.get_allocator().get_personality() == personality01 );
+
+ my_vector vec13(title03, title03 + N3, alloc01);
+ size01 = vec13.size();
+ personality01 = vec13.get_allocator().get_personality();
+ my_vector vec14(title03, title03 + N3, alloc02);
+ size02 = vec14.size();
+ personality02 = vec14.get_allocator().get_personality();
+
+ vec13.swap(vec14);
+ VERIFY( vec13.size() == size02 );
+ VERIFY( equal(vec13.begin(), vec13.end(), title03) );
+ VERIFY( vec14.size() == size01 );
+ VERIFY( equal(vec14.begin(), vec14.end(), title03) );
+ VERIFY( vec13.get_allocator().get_personality() == personality02 );
+ VERIFY( vec14.get_allocator().get_personality() == personality01 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc
new file mode 100644
index 000000000..7806fb24b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/profile/vector.cc
@@ -0,0 +1,24 @@
+// Test vector: performance difference 25% (0.444s vs 0.539s)
+// Advice: set tmp as 10000
+
+// { dg-options "-DITERATIONS=20" { target simulator } }
+
+#ifndef ITERATIONS
+#define ITERATIONS 2000
+#endif
+
+#include <vector>
+
+using std::vector;
+
+int main()
+{
+ vector <int> tmp;
+
+ for (int j=0; j<ITERATIONS; j++)
+ // Insert more than default item
+ for (int i=0; i<10000; i++) {
+ tmp.push_back(i);
+ }
+}
+
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/range_access.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/range_access.cc
new file mode 100644
index 000000000..0d65fc8b9
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/range_access.cc
@@ -0,0 +1,35 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// 24.6.5, range access [iterator.range]
+
+#include <vector>
+
+void
+test01()
+{
+ std::vector<double> v{1.0, 2.0, 3.0};
+ std::begin(v);
+ std::end(v);
+
+ std::vector<bool> vb{true, false, true};
+ std::begin(vb);
+ std::end(vb);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc
new file mode 100644
index 000000000..ed1e6d1dc
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc
@@ -0,0 +1,30 @@
+// { dg-options "-std=gnu++0x" }
+
+// 2007-10-15 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <testsuite_containers.h>
+
+int main()
+{
+ typedef std::vector<int> test_type;
+ __gnu_test::citerator<test_type> test;
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/do_the_right_thing.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/do_the_right_thing.cc
new file mode 100644
index 000000000..d0e274ad3
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/do_the_right_thing.cc
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+// Copyright (C) 2012-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+
+// libstdc++/43813
+void test01()
+{
+ std::vector<double*> v(7, 0);
+ v.assign(7, 0);
+ v.insert(v.begin(), 7, 0);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
new file mode 100644
index 000000000..aa7617365
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
@@ -0,0 +1,34 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1236 }
+
+#include <vector>
+
+struct A
+{
+ explicit A(int) { }
+};
+
+void f()
+{
+ std::vector<A> v;
+ v.assign(10, 1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor.cc
new file mode 100644
index 000000000..e8d3b8342
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor.cc
@@ -0,0 +1,27 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+#include <vector>
+
+void f()
+{
+ std::vector<int> v(10, 1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
new file mode 100644
index 000000000..b4e881d38
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
@@ -0,0 +1,28 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1166 }
+
+#include <vector>
+
+void f()
+{
+ std::vector<std::vector<int> > v(10, 1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
new file mode 100644
index 000000000..74bea148e
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
@@ -0,0 +1,29 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1166 }
+
+#include <vector>
+#include <utility>
+
+void f()
+{
+ std::vector<std::vector<std::pair<char, char> > > v('a', 'b');
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
new file mode 100644
index 000000000..cc46be580
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
@@ -0,0 +1,34 @@
+// 2007-04-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1277 }
+
+#include <vector>
+
+struct A
+{
+ explicit A(int) { }
+};
+
+void f()
+{
+ std::vector<A> v;
+ v.insert(v.begin(), 10, 1);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc
new file mode 100644
index 000000000..4d64e1f3d
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-11-30 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <exception/safety.h>
+
+void
+value()
+{
+ typedef __gnu_cxx::throw_value_limit value_type;
+ typedef __gnu_cxx::throw_allocator_limit<value_type> allocator_type;
+ typedef std::vector<value_type, allocator_type> test_type;
+ __gnu_test::basic_safety<test_type> test;
+}
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ value();
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc
new file mode 100644
index 000000000..6dbee2dbd
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc
@@ -0,0 +1,34 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-09-09 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <exception/safety.h>
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ typedef __gnu_cxx::throw_value_random value_type;
+ typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::vector<value_type, allocator_type> test_type;
+ __gnu_test::generation_prohibited<test_type> test;
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc
new file mode 100644
index 000000000..f0d83c80a
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc
@@ -0,0 +1,34 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
+// 2009-09-09 Benjamin Kosnik <benjamin@redhat.com>
+
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <vector>
+#include <exception/safety.h>
+
+// Container requirement testing, exceptional behavior
+int main()
+{
+ typedef __gnu_cxx::throw_value_limit value_type;
+ typedef __gnu_cxx::throw_allocator_random<value_type> allocator_type;
+ typedef std::vector<value_type, allocator_type> test_type;
+ __gnu_test::propagation_consistent<test_type> test;
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1.cc
new file mode 100644
index 000000000..b8e7adb00
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1.cc
@@ -0,0 +1,25 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <vector>
+
+// { dg-do compile }
+
+template class std::vector<int>;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1_c++0x.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1_c++0x.cc
new file mode 100644
index 000000000..4a7337b89
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/1_c++0x.cc
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <vector>
+
+template class std::vector<int>;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/2.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/2.cc
new file mode 100644
index 000000000..5a1549f77
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/2.cc
@@ -0,0 +1,30 @@
+// Copyright (C) 2004-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <vector>
+#include <testsuite_api.h>
+
+// { dg-do compile }
+
+// N.B. In C++0x mode we cannot instantiate with T == NonDefaultConstructible
+// because of 23.4.1.1.4
+#if __cplusplus < 201103L
+template class std::vector<__gnu_test::NonDefaultConstructible>;
+#endif
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc
new file mode 100644
index 000000000..43123ee25
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc
@@ -0,0 +1,26 @@
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests explicit instantiation of library containers
+
+#include <vector>
+
+// { dg-do compile }
+
+// libstdc++/21770
+template class std::vector<int, std::allocator<char> >;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/4.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/4.cc
new file mode 100644
index 000000000..60a8f2f08
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/4.cc
@@ -0,0 +1,29 @@
+// 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// This file tests explicit instantiation of library containers
+
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_api.h>
+
+// { dg-do compile }
+
+// libstdc++/41792
+template class std::vector<__gnu_test::OverloadedAddress>;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/partial_specialization/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/partial_specialization/1.cc
new file mode 100644
index 000000000..d2b1de91f
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/partial_specialization/1.cc
@@ -0,0 +1,32 @@
+// Copyright (C) 1999-2013 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
+// <http://www.gnu.org/licenses/>.
+
+
+// This file tests user specialization of library containers
+
+#include <vector>
+#include <testsuite_hooks.h>
+
+// { dg-do compile }
+
+struct user_type {};
+
+namespace std
+{
+ template<typename Allocator>
+ class vector<user_type, Allocator> {};
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc
new file mode 100644
index 000000000..bf0965ec5
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc
@@ -0,0 +1,25 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-do compile }
+
+// Copyright (C) 2009-2013 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
+// <http://www.gnu.org/licenses/>.
+
+#include <testsuite_containers.h>
+#include <vector>
+
+// Check container for required typedefs.
+__gnu_test::types<std::vector<int> > t;
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/1.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/1.cc
new file mode 100644
index 000000000..97b6f086b
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/1.cc
@@ -0,0 +1,41 @@
+// 2005-12-01 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+
+#include <vector>
+#include <testsuite_greedy_ops.h>
+
+int main()
+{
+ std::vector<greedy_ops::X> v(5);
+ const std::vector<greedy_ops::X> w(1);
+
+ v[0];
+ w[0];
+ v.size();
+ v.capacity();
+ v.resize(1);
+ v.insert(v.begin(), greedy_ops::X());
+ v.insert(v.begin(), 1, greedy_ops::X());
+ v.insert(v.begin(), w.begin(), w.end());
+ v = w;
+
+ return 0;
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/23767.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/23767.cc
new file mode 100644
index 000000000..47c432be6
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/types/23767.cc
@@ -0,0 +1,43 @@
+// 2005-09-12 Paolo Carlini <pcarlini@suse.de>
+//
+// Copyright (C) 2005-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+
+// { dg-do compile }
+
+#include <vector>
+
+struct T
+{
+ typedef std::vector<int> Vector;
+ typedef Vector::iterator iterator;
+ typedef Vector::const_iterator const_iterator;
+
+ int t(iterator f) { return *f; }
+ int t(const_iterator f) const { return *f; }
+};
+
+// libstdc++/23767
+void f()
+{
+ std::vector<int> v;
+ T t;
+ T::const_iterator i = v.begin();
+
+ t.t(i);
+}
diff --git a/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/zero_sized_allocations.cc b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/zero_sized_allocations.cc
new file mode 100644
index 000000000..ba4daa31d
--- /dev/null
+++ b/gcc-4.8/libstdc++-v3/testsuite/23_containers/vector/zero_sized_allocations.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2007-2013 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
+// <http://www.gnu.org/licenses/>.
+//
+
+#include <vector>
+#include <cstdlib>
+#include <testsuite_hooks.h>
+
+unsigned int zero_sized_news = 0;
+
+void *operator new(size_t size) throw (std::bad_alloc)
+{
+ /* malloc(0) is unpredictable; avoid it. */
+ if (size == 0)
+ {
+ size = 1;
+ ++zero_sized_news;
+ }
+
+ void *p = std::malloc(size);
+
+ if (p == 0)
+ throw std::bad_alloc();
+
+ return p;
+}
+
+void operator delete(void *ptr) throw()
+{
+ if (ptr != 0)
+ std::free(ptr);
+}
+
+// http://gcc.gnu.org/ml/libstdc++/2007-09/msg00006.html
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ std::vector<std::vector<int> > *v;
+ VERIFY( zero_sized_news == 0 );
+
+ v = new std::vector<std::vector<int> >;
+ VERIFY( zero_sized_news == 0 );
+
+ v->resize(10);
+ delete(v);
+ VERIFY( zero_sized_news == 0 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}