From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- .../23_containers/unordered_map/cons/moveable.cc | 43 ++++++ .../unordered_map/debug/construct1_neg.cc | 34 +++++ .../unordered_map/debug/construct2_neg.cc | 34 +++++ .../unordered_map/debug/construct3_neg.cc | 34 +++++ .../unordered_map/debug/construct4_neg.cc | 33 ++++ .../unordered_map/debug/insert1_neg.cc | 34 +++++ .../unordered_map/debug/insert2_neg.cc | 34 +++++ .../unordered_map/debug/insert3_neg.cc | 34 +++++ .../unordered_map/debug/insert4_neg.cc | 33 ++++ .../testsuite/23_containers/unordered_map/dr761.cc | 79 ++++++++++ .../23_containers/unordered_map/erase/1.cc | 129 ++++++++++++++++ .../23_containers/unordered_map/erase/24061-map.cc | 105 +++++++++++++ .../23_containers/unordered_map/erase/51142.cc | 38 +++++ .../unordered_map/hash_policy/dr1189.cc | 48 ++++++ .../23_containers/unordered_map/init-list.cc | 54 +++++++ .../unordered_map/insert/24061-map.cc | 60 ++++++++ .../unordered_map/insert/array_syntax.cc | 56 +++++++ .../unordered_map/insert/array_syntax_move.cc | 59 +++++++ .../unordered_map/insert/map_range.cc | 97 ++++++++++++ .../unordered_map/insert/map_single.cc | 72 +++++++++ .../unordered_map/insert/map_single_move-1.cc | 76 +++++++++ .../unordered_map/insert/map_single_move-2.cc | 79 ++++++++++ .../23_containers/unordered_map/operators/1.cc | 169 +++++++++++++++++++++ .../unordered_map/profile/hash_map.cc | 22 +++ .../unordered_map/profile/unordered.cc | 47 ++++++ .../23_containers/unordered_map/range_access.cc | 31 ++++ .../unordered_map/requirements/citerators.cc | 31 ++++ .../unordered_map/requirements/cliterators.cc | 32 ++++ .../unordered_map/requirements/debug_container.cc | 38 +++++ .../unordered_map/requirements/debug_mode.cc | 30 ++++ .../unordered_map/requirements/exception/basic.cc | 42 +++++ .../exception/generation_prohibited.cc | 36 +++++ .../exception/propagation_consistent.cc | 36 +++++ .../requirements/explicit_instantiation/1.cc | 23 +++ .../requirements/explicit_instantiation/2.cc | 32 ++++ .../requirements/explicit_instantiation/3.cc | 24 +++ .../requirements/explicit_instantiation/4.cc | 33 ++++ .../unordered_map/requirements/typedefs.cc | 25 +++ 38 files changed, 1916 insertions(+) create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/cons/moveable.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/dr761.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/erase/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/erase/24061-map.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/erase/51142.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/hash_policy/dr1189.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/24061-map.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax_move.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_range.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/operators/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/profile/hash_map.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/profile/unordered.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/range_access.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_mode.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/4.cc create mode 100644 libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map') diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/cons/moveable.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/moveable.cc new file mode 100644 index 000000000..ab73be1e7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/cons/moveable.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + + +// NOTE: This makes use of the fact that we know how moveable +// is implemented on map (via swap). If the implementation changed +// this test may begin to fail. + +#include +#include +#include + +int main() +{ + bool test __attribute__((unused)) = true; + + std::unordered_map a,b; + a[2]=0; + b[1]=0; + b = std::move(a); + VERIFY( b.find(2) != b.end() && a.find(1) == a.end() ); + + std::unordered_map c(std::move(b)); + VERIFY( c.find(2) != c.end() ); + VERIFY( b.find(2) == b.end() ); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc new file mode 100644 index 000000000..31961f7ce --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct1_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_construct1 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc new file mode 100644 index 000000000..560651a46 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct2_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_construct2 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc new file mode 100644 index 000000000..7d57272f1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct3_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_construct3 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc new file mode 100644 index 000000000..e37cab21a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/construct4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_construct1<__gnu_debug::unordered_map >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc new file mode 100644 index 000000000..f3d06bf74 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert1_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_insert1 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc new file mode 100644 index 000000000..09d55e190 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert2_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_insert2 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc new file mode 100644 index 000000000..41af75917 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert3_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_insert3 >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc new file mode 100644 index 000000000..6239431bb --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/debug/insert4_neg.cc @@ -0,0 +1,33 @@ +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-options "-std=gnu++0x" } +// { dg-do run { xfail *-*-* } } + +#include +#include + +void test01() +{ + __gnu_test::check_insert1<__gnu_debug::unordered_map >(); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/dr761.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/dr761.cc new file mode 100644 index 000000000..82b67f4ee --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/dr761.cc @@ -0,0 +1,79 @@ +// { dg-options "-std=gnu++0x" } +// 2008-05-22 Paolo Carlini +// +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +// DR 761. unordered_map needs an at() member function. +void test01() +{ + bool test __attribute__((unused)) = true; + typedef std::unordered_map map_type; + + { + map_type m; + m[0] = 1.5; + + double& rd = m.at(0); + VERIFY( rd == 1.5 ); + try + { + m.at(1); + } + catch(std::out_of_range& obj) + { + // Expected. + } + catch(...) + { + // Failed. + throw; + } + } + + { + map_type m; + m[1] = 2.5; + const map_type cm(m); + + const double& crd = cm.at(1); + VERIFY( crd == 2.5 ); + try + { + cm.at(0); + } + catch(std::out_of_range& obj) + { + // Expected. + } + catch(...) + { + // Failed. + throw; + } + } +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/erase/1.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/1.cc new file mode 100644 index 000000000..f9b74e08c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/1.cc @@ -0,0 +1,129 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-02-10 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + m1.insert(value_type("because to why", 1)); + m1.insert(value_type("the stockholm syndrome", 2)); + m1.insert(value_type("a cereous night", 3)); + m1.insert(value_type("eeilo", 4)); + m1.insert(value_type("protean", 5)); + m1.insert(value_type("the way you are when", 6)); + m1.insert(value_type("tillsammans", 7)); + m1.insert(value_type("umbra/penumbra", 8)); + m1.insert(value_type("belonging (no longer mix)", 9)); + m1.insert(value_type("one line behind", 10)); + VERIFY( m1.size() == 10 ); + + VERIFY( m1.erase("eeilo") == 1 ); + VERIFY( m1.size() == 9 ); + iterator it1 = m1.find("eeilo"); + VERIFY( it1 == m1.end() ); + + VERIFY( m1.erase("tillsammans") == 1 ); + VERIFY( m1.size() == 8 ); + iterator it2 = m1.find("tillsammans"); + VERIFY( it2 == m1.end() ); + + // Must work (see DR 526) + iterator it3 = m1.find("belonging (no longer mix)"); + VERIFY( it3 != m1.end() ); + VERIFY( m1.erase(it3->first) == 1 ); + VERIFY( m1.size() == 7 ); + it3 = m1.find("belonging (no longer mix)"); + VERIFY( it3 == m1.end() ); + + VERIFY( !m1.erase("abra") ); + VERIFY( m1.size() == 7 ); + + VERIFY( !m1.erase("eeilo") ); + VERIFY( m1.size() == 7 ); + + VERIFY( m1.erase("because to why") == 1 ); + VERIFY( m1.size() == 6 ); + iterator it4 = m1.find("because to why"); + VERIFY( it4 == m1.end() ); + + iterator it5 = m1.find("umbra/penumbra"); + iterator it6 = m1.find("one line behind"); + VERIFY( it5 != m1.end() ); + VERIFY( it6 != m1.end() ); + + VERIFY( m1.find("the stockholm syndrome") != m1.end() ); + VERIFY( m1.find("a cereous night") != m1.end() ); + VERIFY( m1.find("the way you are when") != m1.end() ); + VERIFY( m1.find("a cereous night") != m1.end() ); + + VERIFY( m1.erase(it5->first) == 1 ); + VERIFY( m1.size() == 5 ); + it5 = m1.find("umbra/penumbra"); + VERIFY( it5 == m1.end() ); + + VERIFY( m1.erase(it6->first) == 1 ); + VERIFY( m1.size() == 4 ); + it6 = m1.find("one line behind"); + VERIFY( it6 == m1.end() ); + + iterator it7 = m1.begin(); + iterator it8 = it7; + ++it8; + iterator it9 = it8; + ++it9; + + VERIFY( m1.erase(it8->first) == 1 ); + VERIFY( m1.size() == 3 ); + VERIFY( ++it7 == it9 ); + + iterator it10 = it9; + ++it10; + iterator it11 = it10; + + VERIFY( m1.erase(it9->first) == 1 ); + VERIFY( m1.size() == 2 ); + VERIFY( ++it10 == m1.end() ); + + VERIFY( m1.erase(m1.begin()) != m1.end() ); + VERIFY( m1.size() == 1 ); + VERIFY( m1.begin() == it11 ); + + VERIFY( m1.erase(m1.begin()->first) == 1 ); + VERIFY( m1.size() == 0 ); + VERIFY( m1.begin() == m1.end() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/erase/24061-map.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/24061-map.cc new file mode 100644 index 000000000..87ab474a8 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/24061-map.cc @@ -0,0 +1,105 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-02-10 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + m1.insert(value_type("all the love in the world", 1)); + m1.insert(value_type("you know what you are?", 2)); + m1.insert(value_type("the collector", 3)); + m1.insert(value_type("the hand that feeds", 4)); + m1.insert(value_type("love is not enough", 5)); + m1.insert(value_type("every day is exactly the same", 6)); + m1.insert(value_type("with teeth", 7)); + m1.insert(value_type("only", 8)); + m1.insert(value_type("getting smaller", 9)); + m1.insert(value_type("sunspots", 10)); + VERIFY( m1.size() == 10 ); + + iterator it1 = m1.begin(); + ++it1; + iterator it2 = it1; + ++it2; + iterator it3 = m1.erase(it1); + VERIFY( m1.size() == 9 ); + VERIFY( it3 == it2 ); + VERIFY( *it3 == *it2 ); + + iterator it4 = m1.begin(); + ++it4; + ++it4; + ++it4; + iterator it5 = it4; + ++it5; + ++it5; + iterator it6 = m1.erase(it4, it5); + VERIFY( m1.size() == 7 ); + VERIFY( it6 == it5 ); + VERIFY( *it6 == *it5 ); + + const_iterator it7 = m1.begin(); + ++it7; + ++it7; + ++it7; + const_iterator it8 = it7; + ++it8; + const_iterator it9 = m1.erase(it7); + VERIFY( m1.size() == 6 ); + VERIFY( it9 == it8 ); + VERIFY( *it9 == *it8 ); + + const_iterator it10 = m1.begin(); + ++it10; + const_iterator it11 = it10; + ++it11; + ++it11; + ++it11; + ++it11; + const_iterator it12 = m1.erase(it10, it11); + VERIFY( m1.size() == 2 ); + VERIFY( it12 == it11 ); + VERIFY( *it12 == *it11 ); + VERIFY( ++it12 == m1.end() ); + + iterator it13 = m1.erase(m1.begin(), m1.end()); + VERIFY( m1.size() == 0 ); + VERIFY( it13 == it12 ); + VERIFY( it13 == m1.begin() ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/erase/51142.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/51142.cc new file mode 100644 index 000000000..eab637df2 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/erase/51142.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2011 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +#include + +struct X +{ + template + X(T&) {} +}; + +bool operator==(const X&, const X&) { return false; } + +// LWG 2059. +void erasor(std::unordered_map& s, X x) +{ + std::unordered_map::iterator it = s.find(x); + if (it != s.end()) + s.erase(it); +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/hash_policy/dr1189.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/hash_policy/dr1189.cc new file mode 100644 index 000000000..f89d5f199 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/hash_policy/dr1189.cc @@ -0,0 +1,48 @@ +// { dg-options "-std=gnu++0x" } +// 2010-03-10 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +// DR 1189. Awkward interface for changing the number of buckets +// in an unordered associative container +void test01() +{ + bool test __attribute__((unused)) = true; + + std::unordered_map m1; + m1.reserve(10); + VERIFY( m1.bucket_count() >= 10 ); + + m1.reserve(100); + VERIFY( m1.bucket_count() >= 100 ); + + std::unordered_map m2(100); + VERIFY( m2.bucket_count() >= 100 ); + + m2.reserve(1000); + VERIFY( m2.bucket_count() >= 1000 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc new file mode 100644 index 000000000..262fa0eb9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/init-list.cc @@ -0,0 +1,54 @@ +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// + +// { dg-options "-std=gnu++0x" } + +#include +#include + +using namespace std; + +int test01() +{ + bool test __attribute__((unused)) = true; + + unordered_map m({ { 1, 1.0 }, { 2, 2.0 }, { 42, 237.0 } }); + VERIFY(m.size() == 3); + VERIFY(m[1] == 1.0); + VERIFY(m[2] == 2.0); + VERIFY(m[42] == 237.0); + + m = { {5, 55.0}, { 6, 66.0 } }; + VERIFY(m.size() == 2); + VERIFY(m[5] == 55.0); + VERIFY(m[6] == 66.0); + + m.insert({ { 7, 77.0 }, { 8, 88.0 } }); + VERIFY(m.size() == 4); + VERIFY(m[5] == 55.0); + VERIFY(m[6] == 66.0); + VERIFY(m[7] == 77.0); + VERIFY(m[8] == 88.0); + return test; +} + +int main() +{ + __gnu_test::set_memory_limits(); + test01(); +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/24061-map.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/24061-map.cc new file mode 100644 index 000000000..d9a187870 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/24061-map.cc @@ -0,0 +1,60 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-02-10 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include + +// libstdc++/24061 +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef Map::iterator iterator; + typedef Map::const_iterator const_iterator; + typedef Map::value_type value_type; + + Map m1; + + iterator it1 = m1.insert(m1.begin(), + value_type("all the love in the world", 1)); + VERIFY( m1.size() == 1 ); + VERIFY( *it1 == value_type("all the love in the world", 1) ); + + const_iterator cit1(it1); + const_iterator cit2 = m1.insert(cit1, + value_type("you know what you are?", 2)); + VERIFY( m1.size() == 2 ); + VERIFY( cit2 != cit1 ); + VERIFY( *cit2 == value_type("you know what you are?", 2) ); + + iterator it2 = m1.insert(it1, value_type("all the love in the world", 3)); + VERIFY( m1.size() == 2 ); + VERIFY( it2 == it1 ); + VERIFY( *it2 == value_type("all the love in the world", 1) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax.cc new file mode 100644 index 000000000..91f58799a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax.cc @@ -0,0 +1,56 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// Array version of insert + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + + Map m; + VERIFY( m.empty() ); + + m["red"] = 17; + VERIFY( m.size() == 1 ); + VERIFY( m.begin()->first == "red" ); + VERIFY( m.begin()->second == 17 ); + VERIFY( m["red"] == 17 ); + + m["blue"] = 9; + VERIFY( m.size() == 2 ); + VERIFY( m["blue"] == 9 ); + + m["red"] = 5; + VERIFY( m.size() == 2 ); + VERIFY( m["red"] == 5 ); + VERIFY( m["blue"] == 9 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax_move.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax_move.cc new file mode 100644 index 000000000..b0729e327 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/array_syntax_move.cc @@ -0,0 +1,59 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-10-27 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// Array version of insert + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::rvalstruct; + + typedef std::unordered_map Map; + + Map m; + VERIFY( m.empty() ); + + m[rvalstruct(1)] = rvalstruct(17); + VERIFY( m.size() == 1 ); + VERIFY( (m.begin()->first).val == 1 ); + VERIFY( (m.begin()->second).val == 17 ); + VERIFY( m[rvalstruct(1)].val == 17 ); + + m[rvalstruct(2)] = rvalstruct(9); + VERIFY( m.size() == 2 ); + VERIFY( m[rvalstruct(2)].val == 9 ); + + m[rvalstruct(1)] = rvalstruct(5); + VERIFY( m.size() == 2 ); + VERIFY( m[rvalstruct(1)].val == 5 ); + VERIFY( m[rvalstruct(2)].val == 9 ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_range.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_range.cc new file mode 100644 index 000000000..5e5298c04 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_range.cc @@ -0,0 +1,97 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// range insert + +#include +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[5] = + { + Pair("red", 5), + Pair("green", 9), + Pair("blue", 3), + Pair("cyan", 8), + Pair("magenta", 7) + }; + + m.insert(A+0, A+5); + VERIFY(m.size() == 5); + VERIFY(std::distance(m.begin(), m.end()) == 5); + + VERIFY(m["red"] == 5); + VERIFY(m["green"] == 9); + VERIFY(m["blue"] == 3); + VERIFY(m["cyan"] == 8); + VERIFY(m["magenta"] == 7); +} + +void test02() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY(m.empty()); + + Pair A[9] = + { + Pair("red", 5), + Pair("green", 9), + Pair("red", 19), + Pair("blue", 3), + Pair("blue", 60), + Pair("cyan", 8), + Pair("magenta", 7), + Pair("blue", 99), + Pair("green", 33) + }; + + m.insert(A+0, A+9); + VERIFY(m.size() == 5); + VERIFY(std::distance(m.begin(), m.end()) == 5); + + VERIFY(m["red"] == 5); + VERIFY(m["green"] == 9); + VERIFY(m["blue"] == 3); + VERIFY(m["cyan"] == 8); + VERIFY(m["magenta"] == 7); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single.cc new file mode 100644 index 000000000..3905e26c9 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single.cc @@ -0,0 +1,72 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// Single-element insert + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY(m.empty()); + + std::pair p = m.insert(Pair("abcde", 3)); + VERIFY(p.second); + VERIFY(m.size() == 1); + VERIFY(std::distance(m.begin(), m.end()) == 1); + VERIFY(p.first == m.begin()); + VERIFY(p.first->first == "abcde"); + VERIFY(p.first->second == 3); +} + +void test02() +{ + bool test __attribute__((unused)) = true; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY(m.empty()); + + std::pair p1 = m.insert(Pair("abcde", 3)); + std::pair p2 = m.insert(Pair("abcde", 7)); + + VERIFY(p1.second); + VERIFY(!p2.second); + VERIFY(m.size() == 1); + VERIFY(p1.first == p2.first); + VERIFY(p1.first->first == "abcde"); + VERIFY(p2.first->second == 3); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-1.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-1.cc new file mode 100644 index 000000000..45186ce45 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-1.cc @@ -0,0 +1,76 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-10-27 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// Single-element insert + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::rvalstruct; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY( m.empty()); + + std::pair p = m.insert(Pair(1, rvalstruct(3))); + VERIFY( p.second ); + VERIFY( m.size() == 1 ); + VERIFY( std::distance(m.begin(), m.end()) == 1 ); + VERIFY( p.first == m.begin() ); + VERIFY( p.first->first == 1 ); + VERIFY( (p.first->second).val == 3 ); +} + +void test02() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::rvalstruct; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY( m.empty() ); + + std::pair p1 = m.insert(Pair(2, rvalstruct(3))); + std::pair p2 = m.insert(Pair(2, rvalstruct(7))); + + VERIFY( p1.second ); + VERIFY( !p2.second ); + VERIFY( m.size() == 1 ); + VERIFY( p1.first == p2.first ); + VERIFY( p1.first->first == 2 ); + VERIFY( (p2.first->second).val == 3 ); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-2.cc new file mode 100644 index 000000000..76b6bba00 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/insert/map_single_move-2.cc @@ -0,0 +1,79 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-10-27 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// Single-element insert + +#include +#include +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::rvalstruct; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY( m.empty()); + + std::pair p = m.insert(Pair(rvalstruct(1), + rvalstruct(3))); + VERIFY( p.second ); + VERIFY( m.size() == 1 ); + VERIFY( std::distance(m.begin(), m.end()) == 1 ); + VERIFY( p.first == m.begin() ); + VERIFY( (p.first->first).val == 1 ); + VERIFY( (p.first->second).val == 3 ); +} + +void test02() +{ + bool test __attribute__((unused)) = true; + using __gnu_test::rvalstruct; + + typedef std::unordered_map Map; + typedef std::pair Pair; + + Map m; + VERIFY( m.empty() ); + + std::pair p1 = m.insert(Pair(rvalstruct(2), + rvalstruct(3))); + std::pair p2 = m.insert(Pair(rvalstruct(2), + rvalstruct(7))); + + VERIFY( p1.second ); + VERIFY( !p2.second ); + VERIFY( m.size() == 1 ); + VERIFY( p1.first == p2.first ); + VERIFY( (p1.first->first).val == 2 ); + VERIFY( (p2.first->second).val == 3 ); +} + +int main() +{ + test01(); + test02(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/operators/1.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/operators/1.cc new file mode 100644 index 000000000..f5e68dea7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/operators/1.cc @@ -0,0 +1,169 @@ +// { dg-options "-std=gnu++0x" } + +// 2010-03-25 Paolo Carlini + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +void test01() +{ + bool test __attribute__((unused)) = true; + + typedef std::pair Pair; + std::unordered_map um1, um2; + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(2, -1)); + um2.insert(Pair(2, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(3, -3)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um2.insert(Pair(3, -3)); + VERIFY( (um1 == um2) ); + VERIFY( !(um1 != um2) ); + + um2.clear(); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.clear(); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(2, -2)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(2, -2)); + um2.insert(Pair(1, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(3, -3)); + um2.insert(Pair(4, -4)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(4, -4)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um2.insert(Pair(3, -3)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(4, -4)); + um2.insert(Pair(4, -4)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.clear(); + um2.clear(); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -2)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.clear(); + um2.clear(); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(2, -2)); + um2.insert(Pair(2, -3)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(2, -3)); + um2.insert(Pair(2, -2)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.clear(); + um2.clear(); + VERIFY( um1 == um2 ); + VERIFY( !(um1 != um2) ); + + um1.insert(Pair(2, -2)); + um2.insert(Pair(2, -3)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(2, -3)); + um2.insert(Pair(2, -2)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -1)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + um1.insert(Pair(1, -1)); + um2.insert(Pair(1, -2)); + VERIFY( um1 != um2 ); + VERIFY( !(um1 == um2) ); + + const std::unordered_map cum1(um1), cum2(um2); + VERIFY( cum1 != cum2 ); + VERIFY( !(cum1 == cum2) ); + VERIFY( cum1 != um2 ); + VERIFY( !(um1 == cum2) ); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/profile/hash_map.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/profile/hash_map.cc new file mode 100644 index 000000000..7939a35e3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/profile/hash_map.cc @@ -0,0 +1,22 @@ +// { dg-options "-Wno-deprecated" } +/* testing the gcc instrumented */ + +#include +using namespace std; +using __gnu_cxx::hash_map; + +int main() +{ + hash_map *tmp; + + for (int j=1; j<=10; j++) + { + tmp = new hash_map; + // Insert more than default item + for (int i=0; i<10000*j; i++) { + (*tmp)[i]= i; + } + delete tmp; + } +} + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/profile/unordered.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/profile/unordered.cc new file mode 100644 index 000000000..93b506e98 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/profile/unordered.cc @@ -0,0 +1,47 @@ +// { dg-options "-std=gnu++0x" } +/* testing the gcc instrumented */ + +#include +#include +using std::unordered_map; +using std::unordered_set; + +void test_unordered_set() +{ + // Test for unordered set + unordered_set *tmp2; + tmp2 = new unordered_set; + tmp2->insert(1); + delete tmp2; +} +void test_unordered_map() +{ + unordered_map *tmp; + for (int i=0; i<20; i++) + { + tmp = new unordered_map(i+2); + // Insert more than default item + for (int j=0; j<10000; j++) { + (*tmp)[j]= j; + } + + delete tmp; + } + + tmp = new unordered_map; + + // Insert more than default item + for (int i=0; i<150000; i++) { +// (*tmp)[i] = i; + (*tmp).insert(unordered_map::value_type(i, i)); + } + + (*tmp).erase(1); + delete tmp; +} +int main() +{ + test_unordered_set(); + test_unordered_map(); +} + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/range_access.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/range_access.cc new file mode 100644 index 000000000..1555c4896 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/range_access.cc @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// 24.6.5, range access [iterator.range] + +#include + +void +test01() +{ + std::unordered_map um{{1, 1.0}, {2, 2.0}, {3, 3.0}}; + std::begin(um); + std::end(um); +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc new file mode 100644 index 000000000..a00635a56 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc @@ -0,0 +1,31 @@ +// { dg-options "-std=gnu++0x" } + +// 2007-10-15 Paolo Carlini + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +int main() +{ + typedef std::unordered_map test_type; + __gnu_test::citerator test; + return 0; +} + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc new file mode 100644 index 000000000..3cad0a16a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc @@ -0,0 +1,32 @@ +// { dg-options "-std=gnu++0x" } + +// 2008-06-11 Paolo Carlini + +// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +int main() +{ + typedef std::unordered_map test_type; + typedef typename test_type::value_type value_type; + value_type v(1, 1); + __gnu_test::forward_members_unordered test(v); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc new file mode 100644 index 000000000..632070996 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_container.cc @@ -0,0 +1,38 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +using namespace __gnu_debug; + +using std::allocator; +using std::equal_to; +using std::hash; +using std::pair; +using std::string; + +template class unordered_map; +template class unordered_map, equal_to, + allocator > >; +template class unordered_map, equal_to, + allocator >; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_mode.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_mode.cc new file mode 100644 index 000000000..8b2fe14ca --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/debug_mode.cc @@ -0,0 +1,30 @@ +// NB: This issue affected only debug-mode. + +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +//PR libstdc++/35922 +int main() +{ + std::unordered_map m; +} + diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc new file mode 100644 index 000000000..bcad65f8a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000..7ed320198 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000..7bb555f41 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc new file mode 100644 index 000000000..9027fdcc1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc @@ -0,0 +1,23 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc new file mode 100644 index 000000000..7f4e05138 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc @@ -0,0 +1,32 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +typedef __gnu_test::NonDefaultConstructible inst_type; +typedef __gnu_test::NonDefaultConstructible_hash hash_type; + +// N.B. We cannot instantiate with mapped_type == NonDefaultConstructible +// because of 23.5.1.2. +template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc new file mode 100644 index 000000000..695fa6f58 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc @@ -0,0 +1,24 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2007, 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std; +template class unordered_map, equal_to, allocator>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/4.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/4.cc new file mode 100644 index 000000000..37b57b371 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/4.cc @@ -0,0 +1,33 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// 2010-05-20 Paolo Carlini +// +// Copyright (C) 2010 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// This file tests explicit instantiation of library containers + +#include +#include +#include + +typedef __gnu_test::OverloadedAddress inst_type; +typedef __gnu_test::OverloadedAddress_hash hash_type; + +// libstdc++/41792 +template class std::unordered_map; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc new file mode 100644 index 000000000..9b978cebc --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc @@ -0,0 +1,25 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2009 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +// Check container for required typedefs. +__gnu_test::types > t; -- cgit v1.2.3