diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-25 22:29:08 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-25 22:29:08 +0000 |
commit | 43308b7e11b2c491063a4670effa18588b07037f (patch) | |
tree | 57b49f93cf285f8979379f2249d8b9a3d4bcb0e0 /libstdc++-v3/testsuite/23_containers/unordered_map/requirements | |
parent | 31c1975b01f8fc172a444b3395250e33396e0def (diff) | |
download | gcc-43308b7e11b2c491063a4670effa18588b07037f.tar.gz |
2009-08-25 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/basic_string.h (basic_string): Add cbegin(),
cend(), crbegin(), crend() in C++0x mode.
* config/abi/pre/gnu.ver: Add exports.
* testsuite/util/testsuite_containers.h: New.
* testsuite/util/testsuite_container_traits.h: New.
* testsuite/21_strings/basic_string/requirements/citerators.cc: New.
* testsuite/21_strings/basic_string/requirements/typedefs.cc: New.
* testsuite/ext/vstring/requirements/citerators.cc: Edit.
* testsuite/ext/vstring/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_map/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_map/requirements/typedefs.cc: Edit.
* testsuite/23_containers/unordered_map/requirements/
explicit_instantiation.cc: Move to nested directory.
* testsuite/23_containers/queue/requirements/typedefs.cc: New.
* testsuite/23_containers/priority_queue/requirements/typedefs.cc: New.
* testsuite/23_containers/multimap/requirements/citerators.cc: Edit.
* testsuite/23_containers/multimap/requirements/typedefs.cc: New.
* testsuite/23_containers/set/requirements/citerators.cc: Edit.
* testsuite/23_containers/set/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/2.cc: Edit.: New.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_multimap/requirements/
typedefs.cc: Edit.
* testsuite/23_containers/unordered_multimap/requirements/
explicit_instantiation.cc: Move to nested.
* testsuite/23_containers/forward_list/requirements/citerators.cc: New.
* testsuite/23_containers/forward_list/requirements/1.cc: Remove.
* testsuite/23_containers/forward_list/requirements/dr438/
insert_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
assign_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_1_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor_2_neg.cc: New.
* testsuite/23_containers/forward_list/requirements/dr438/
constructor.cc: New.
* testsuite/23_containers/forward_list/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_set/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_set/requirements/typedefs.cc: Edit.
* testsuite/23_containers/unordered_set/requirements/
explicit_instantiation.cc: Move to nested.
* testsuite/23_containers/vector/requirements/citerators.cc: Edit.
* testsuite/23_containers/vector/requirements/dr438/bool/
constructor.cc: Move.
* testsuite/23_containers/vector/requirements/typedefs.cc: New.
* testsuite/23_containers/vector/bool/requirements/citerators.cc: Edit.
* testsuite/23_containers/vector/bool/requirements/dr438/
constructor.cc: New.
* testsuite/23_containers/deque/requirements/citerators.cc: Edit.
* testsuite/23_containers/deque/requirements/typedefs.cc
* testsuite/23_containers/stack/requirements/typedefs.cc
* testsuite/23_containers/multiset/requirements/citerators.cc: Edit.
* testsuite/23_containers/multiset/requirements/typedefs.cc: New.
* testsuite/23_containers/list/requirements/citerators.cc: Edit.
* testsuite/23_containers/list/requirements/typedefs.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
cliterators.cc: Edit.
* testsuite/23_containers/unordered_multiset/requirements/
citerators.cc: Edit.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation.cc: Move.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/
explicit_instantiation/3.cc: New.
* testsuite/23_containers/unordered_multiset/requirements/typedefs.cc
* testsuite/23_containers/map/requirements/citerators.cc: Edit.
* testsuite/23_containers/map/requirements/typedefs.cc: New.
* testsuite/23_containers/array/requirements/citerators.cc: Edit.
* testsuite/23_containers/array/requirements/explicit_instantiation.cc:
Move.
* testsuite/23_containers/array/requirements/
explicit_instantiation/1.cc: New.
* testsuite/23_containers/array/requirements/
explicit_instantiation/2.cc: New.
* testsuite/23_containers/array/requirements/typedefs.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151106 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers/unordered_map/requirements')
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc | 19 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc | 22 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc (renamed from libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc) | 0 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc | 28 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc | 24 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc | 31 |
6 files changed, 66 insertions, 58 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc index b8f9d502a0d..a00635a568f 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/citerators.cc @@ -19,24 +19,13 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_map> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_map<int, int> um; - um[1] = 1; - VERIFY( um.cbegin() == um.begin() ); - VERIFY( um.cend() == um.end() ); - VERIFY( um.cbegin() != um.cend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_map<int, int> test_type; + __gnu_test::citerator<test_type> 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 index a6729a314be..3cad0a16a06 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_map> -#include <testsuite_hooks.h> - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_map<int, int> um_type; - um_type um; - um[1] = 1; - VERIFY( um.cbegin(0) == um.begin(0) ); - VERIFY( um.cend(0) == um.end(0) ); - const um_type::size_type bn = um.bucket(1); - VERIFY( um.cbegin(bn) != um.cend(bn) ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_map<int, int> test_type; + typedef typename test_type::value_type value_type; + value_type v(1, 1); + __gnu_test::forward_members_unordered<test_type> test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc index 9027fdcc144..9027fdcc144 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/1.cc 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 00000000000..f6b5fe37274 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/2.cc @@ -0,0 +1,28 @@ +// { 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 +// <http://www.gnu.org/licenses/>. + +// This file tests explicit instantiation of library containers + +#include <unordered_map> +#include <testsuite_hooks.h> +#include <testsuite_api.h> + +typedef __gnu_test::NonDefaultConstructible inst_type; +template class std::unordered_map<inst_type, inst_type>; 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 00000000000..695fa6f58e3 --- /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 +// <http://www.gnu.org/licenses/>. + +#include <unordered_map> + +using namespace std; +template class unordered_map<int, int, hash<int>, equal_to<int>, allocator<char>>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc index 6985a9b565b..9b978cebc20 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/typedefs.cc @@ -1,9 +1,7 @@ -// { dg-do compile } // { dg-options "-std=gnu++0x" } +// { dg-do compile } -// 2008-08-27 Paolo Carlini <paolo.carlini@oracle.com> - -// Copyright (C) 2008, 2009 Free Software Foundation +// 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 @@ -20,27 +18,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +#include <testsuite_containers.h> #include <unordered_map> -void test01() -{ - // Check for required typedefs - typedef std::unordered_map<int, int> test_type; - - typedef test_type::key_type key_type; - typedef test_type::value_type value_type; - typedef test_type::mapped_type mapped_type; - typedef test_type::hasher hasher; - typedef test_type::key_equal key_equal; - typedef test_type::allocator_type allocator_type; - typedef test_type::pointer pointer; - typedef test_type::const_pointer const_pointer; - typedef test_type::reference reference; - typedef test_type::const_reference const_reference; - typedef test_type::size_type size_type; - typedef test_type::difference_type difference_type; - typedef test_type::iterator iterator; - typedef test_type::const_iterator const_iterator; - typedef test_type::local_iterator local_iterator; - typedef test_type::const_local_iterator const_local_iterator; -} +// Check container for required typedefs. +__gnu_test::types<std::unordered_map<int, long> > t; |