diff options
Diffstat (limited to 'libstdc++-v3/testsuite/23_containers')
55 files changed, 810 insertions, 461 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc index 0597dcfc5ff..c448a8419ec 100644 --- a/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <array> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::array<int, 7> a; - VERIFY( a.cbegin() == a.begin() ); - VERIFY( a.cend() == a.end() ); - VERIFY( a.crbegin() == a.rbegin() ); - VERIFY( a.crend() == a.rend() ); - VERIFY( a.cbegin() != a.cend() ); - VERIFY( a.crbegin() != a.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::array<int, 7> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc index 75fcb3cddaf..0e104412416 100644 --- a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/1.cc @@ -18,7 +18,6 @@ // along with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <array> template class std::array<int, 5>; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..aadf76b7223 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/explicit_instantiation/2.cc @@ -0,0 +1,27 @@ +// { 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 <array> +#include <testsuite_hooks.h> +#include <testsuite_api.h> + +template class std::array<__gnu_test::NonDefaultConstructible, 3>; diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/typedefs.cc new file mode 100644 index 00000000000..152988df76f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <array> + +// Check container for required typedefs. +__gnu_test::types<std::array<int, 10> > t; diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc index dd4179da906..4a05e606010 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/citerators.cc @@ -19,26 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <deque> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::deque<int> d(7); - VERIFY( d.cbegin() == d.begin() ); - VERIFY( d.cend() == d.end() ); - VERIFY( d.crbegin() == d.rbegin() ); - VERIFY( d.crend() == d.rend() ); - VERIFY( d.cbegin() != d.cend() ); - VERIFY( d.crbegin() != d.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::deque<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/typedefs.cc new file mode 100644 index 00000000000..6263951fed7 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <deque> + +// Check container for required typedefs. +__gnu_test::types<std::deque<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc deleted file mode 100644 index 67aa70bccb8..00000000000 --- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/1.cc +++ /dev/null @@ -1,69 +0,0 @@ -// { dg-options "-std=gnu++0x" } - -// 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 Pred the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more 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.3.n forward_list xxx [lib.forward_list.xxx] - -#include <forward_list> -#include <testsuite_hooks.h> - -bool test __attribute__((unused)) = true; - -// A nontrivial type. -template<typename T> - struct A { }; - -// Another nontrivial type -struct B { }; - -// A nontrivial type convertible from an int -struct C -{ - C(int i) : i_(i) { } - bool operator==(const C& rhs) { return i_ == rhs.i_; } - int i_; -}; - -// This test verifies the following. -// -void -test01() -{ - std::forward_list< A<B> > lst; - VERIFY(lst.begin() == lst.end()); - VERIFY(std::distance(lst.begin(), lst.end()) == 0); - - // check type definitions -- will fail compile if missing - typedef std::forward_list< A<B> >::reference reference; - typedef std::forward_list< A<B> >::const_reference const_reference; - typedef std::forward_list< A<B> >::iterator iterator; - typedef std::forward_list< A<B> >::const_iterator const_iterator; - typedef std::forward_list< A<B> >::size_type size_type; - typedef std::forward_list< A<B> >::difference_type difference_type; - typedef std::forward_list< A<B> >::value_type value_type; - typedef std::forward_list< A<B> >::allocator_type allocator_type; - typedef std::forward_list< A<B> >::pointer pointer; - typedef std::forward_list< A<B> >::const_pointer const_pointer; -} - -int -main() -{ - test01(); - return 0; -} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc new file mode 100644 index 00000000000..86fa26e3198 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/citerators.cc @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } + +// 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/>. + +#include <forward_list> +#include <testsuite_containers.h> + +namespace __gnu_test +{ + template<> + struct populate<std::forward_list<int>, true> + { + populate(std::forward_list<int>& container) + { + container.push_front(1); + container.push_front(2); + } + }; +} + +int main() +{ + typedef std::forward_list<int> test_type; + __gnu_test::citerator<test_type> test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc new file mode 100644 index 00000000000..93f0e6d591d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc @@ -0,0 +1,35 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-error "no matching" "" { target *-*-* } 1209 } +// { dg-excess-errors "" } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more 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 <forward_list> + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + typedef std::forward_list<A> test_type; + test_type l; + l.assign(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc new file mode 100644 index 00000000000..407d8d16942 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor.cc @@ -0,0 +1,27 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more 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 <forward_list> + +void f() +{ + typedef std::forward_list<int> test_type; + test_type l(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc new file mode 100644 index 00000000000..70d0447a5d6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-error "no matching" "" { target *-*-* } 1209 } +// { dg-excess-errors "" } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more 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 <forward_list> + +void f() +{ + typedef std::forward_list<std::forward_list<int> > test_type; + test_type l(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc new file mode 100644 index 00000000000..2ee8b9f6baf --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc @@ -0,0 +1,30 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-error "no matching" "" { target *-*-* } 1209 } +// { dg-excess-errors "" } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more 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 <forward_list> +#include <utility> + +void f() +{ + typedef std::forward_list<std::forward_list<std::pair<char, char> > > test_type; + test_type l('a', 'b'); +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc new file mode 100644 index 00000000000..a21c22242b3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc @@ -0,0 +1,35 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } +// { dg-error "no matching" "" { target *-*-* } 1209 } +// { dg-excess-errors "" } + +// Copyright (C) 2009 Free Software Foundation +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more 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 <forward_list> + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + typedef std::forward_list<A> test_type; + test_type l; + l.insert_after(l.begin(), 10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/typedefs.cc new file mode 100644 index 00000000000..3497b09de7c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <forward_list> + +// Check container for required typedefs. +__gnu_test::types<std::forward_list<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc index 6bcffbb05ee..ac5bdec983a 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/citerators.cc @@ -19,28 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <list> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::list<int> list_type; - list_type l(7); - - VERIFY( l.cbegin() == l.begin() ); - VERIFY( l.cend() == l.end() ); - VERIFY( l.crbegin() == l.rbegin() ); - VERIFY( l.crend() == l.rend() ); - VERIFY( l.cbegin() != l.cend() ); - VERIFY( l.crbegin() != l.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::list<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/typedefs.cc new file mode 100644 index 00000000000..444ebb540a5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <list> + +// Check container for required typedefs. +__gnu_test::types<std::list<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc index 05e10aad2a6..17db1e7da38 100644 --- a/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <map> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::map<int, int> m; - m[1] = 1; - VERIFY( m.cbegin() == m.begin() ); - VERIFY( m.cend() == m.end() ); - VERIFY( m.crbegin() == m.rbegin() ); - VERIFY( m.crend() == m.rend() ); - VERIFY( m.cbegin() != m.cend() ); - VERIFY( m.crbegin() != m.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::map<int, int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/typedefs.cc new file mode 100644 index 00000000000..1325cc607de --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <map> + +// Check container for required typedefs. +__gnu_test::types<std::map<int, long> > t; diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc index 2daa88564cc..15773cb5126 100644 --- a/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/citerators.cc @@ -19,28 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <map> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::multimap<int, int> mm_type; - mm_type mm; - mm.insert(mm_type::value_type(1, 1)); - VERIFY( mm.cbegin() == mm.begin() ); - VERIFY( mm.cend() == mm.end() ); - VERIFY( mm.crbegin() == mm.rbegin() ); - VERIFY( mm.crend() == mm.rend() ); - VERIFY( mm.cbegin() != mm.cend() ); - VERIFY( mm.crbegin() != mm.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::multimap<int, int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/typedefs.cc new file mode 100644 index 00000000000..38a4bc5358c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <map> + +// Check container for required typedefs. +__gnu_test::types<std::multimap<int, long> > t; diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc index 2efd054f62a..bf3aa16447c 100644 --- a/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <set> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::multiset<int> ms; - ms.insert(1); - VERIFY( ms.cbegin() == ms.begin() ); - VERIFY( ms.cend() == ms.end() ); - VERIFY( ms.crbegin() == ms.rbegin() ); - VERIFY( ms.crend() == ms.rend() ); - VERIFY( ms.cbegin() != ms.cend() ); - VERIFY( ms.crbegin() != ms.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::multiset<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/typedefs.cc new file mode 100644 index 00000000000..7244003c282 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <set> + +// Check container for required typedefs. +__gnu_test::types<std::multiset<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/priority_queue/requirements/typedefs.cc new file mode 100644 index 00000000000..86fcb0c1337 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/priority_queue/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <queue> + +// Check container for required typedefs. +__gnu_test::types<std::priority_queue<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/queue/requirements/typedefs.cc new file mode 100644 index 00000000000..7563a2cc937 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/queue/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <queue> + +// Check container for required typedefs. +__gnu_test::types<std::queue<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc index d2cfd4c9165..20dd8b9f1e4 100644 --- a/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/citerators.cc @@ -19,27 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <set> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::set<int> s; - s.insert(1); - VERIFY( s.cbegin() == s.begin() ); - VERIFY( s.cend() == s.end() ); - VERIFY( s.crbegin() == s.rbegin() ); - VERIFY( s.crend() == s.rend() ); - VERIFY( s.cbegin() != s.cend() ); - VERIFY( s.crbegin() != s.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::set<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/typedefs.cc new file mode 100644 index 00000000000..0581e49ecbe --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <set> + +// Check container for required typedefs. +__gnu_test::types<std::set<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/stack/requirements/typedefs.cc new file mode 100644 index 00000000000..d0f56e5d60c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/stack/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <stack> + +// Check container for required typedefs. +__gnu_test::types<std::stack<int> > t; 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; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc index dec0f50027a..736220b73bf 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/citerators.cc @@ -19,25 +19,12 @@ // 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; - - typedef std::unordered_multimap<int, int> umm_type; - umm_type umm; - umm.insert(umm_type::value_type(1, 1)); - VERIFY( umm.cbegin() == umm.begin() ); - VERIFY( umm.cend() == umm.end() ); - VERIFY( umm.cbegin() != umm.cend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_multimap<int, int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc index d764369bf41..612787cc763 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/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_multimap<int, int> umm_type; - umm_type umm; - umm.insert(umm_type::value_type(1, 1)); - VERIFY( umm.cbegin(0) == umm.begin(0) ); - VERIFY( umm.cend(0) == umm.end(0) ); - const umm_type::size_type bn = umm.bucket(1); - VERIFY( umm.cbegin(bn) != umm.cend(bn) ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_multimap<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_multimap/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/1.cc index 863562db855..863562db855 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..e26428dd698 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/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_multimap<inst_type, inst_type>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc new file mode 100644 index 00000000000..5085f611071 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/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_multimap<int, int, hash<int>, equal_to<int>, allocator<char>>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc index e272e19f2d0..eb1b9157a5c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/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_multimap<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_multimap<int, long> > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc index 0db11958d2e..6731848fe6c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/citerators.cc @@ -19,24 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_set> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_multiset<int> ums; - ums.insert(1); - VERIFY( ums.cbegin() == ums.begin() ); - VERIFY( ums.cend() == ums.end() ); - VERIFY( ums.cbegin() != ums.cend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_multiset<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc index ccaf1b677bf..c9db47ce500 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_set> -#include <testsuite_hooks.h> - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_multiset<int> ums_type; - ums_type ums; - ums.insert(1); - VERIFY( ums.cbegin(0) == ums.begin(0) ); - VERIFY( ums.cend(0) == ums.end(0) ); - const ums_type::size_type bn = ums.bucket(1); - VERIFY( ums.cbegin(bn) != ums.cend(bn) ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_multiset<int> test_type; + typedef typename test_type::value_type value_type; + value_type v(1); + __gnu_test::forward_members_unordered<test_type> test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/1.cc index a8fbbd081b5..a8fbbd081b5 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..d2a120a533e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/2.cc @@ -0,0 +1,27 @@ +// { 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_set> +#include <testsuite_hooks.h> +#include <testsuite_api.h> + +template class std::unordered_multiset<__gnu_test::NonDefaultConstructible>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc new file mode 100644 index 00000000000..faf119ca26e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/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_set> + +using namespace std; +template class unordered_multiset<int, hash<int>, equal_to<int>, allocator<char>>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc index edd47a325f6..7e65e3a214c 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/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,26 +18,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +#include <testsuite_containers.h> #include <unordered_set> -void test01() -{ - // Check for required typedefs - typedef std::unordered_multiset<int> test_type; - - typedef test_type::key_type key_type; - typedef test_type::value_type value_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_multiset<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc index 765d99cbf61..ce7f79fd69d 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/citerators.cc @@ -19,24 +19,12 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_set> -#include <testsuite_hooks.h> - -void -test01() -{ - bool test __attribute__((unused)) = true; - - std::unordered_set<int> us; - us.insert(1); - VERIFY( us.cbegin() == us.begin() ); - VERIFY( us.cend() == us.end() ); - VERIFY( us.cbegin() != us.cend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_set<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc index ef356b6ddbd..8abef8c1c9a 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/cliterators.cc @@ -19,26 +19,14 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. - #include <unordered_set> -#include <testsuite_hooks.h> - -// DR 691. -void test01() -{ - bool test __attribute__((unused)) = true; - - typedef std::unordered_set<int> us_type; - us_type us; - us.insert(1); - VERIFY( us.cbegin(0) == us.begin(0) ); - VERIFY( us.cend(0) == us.end(0) ); - const us_type::size_type bn = us.bucket(1); - VERIFY( us.cbegin(bn) != us.cend(bn) ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::unordered_set<int> test_type; + typedef typename test_type::value_type value_type; + value_type v(1); + __gnu_test::forward_members_unordered<test_type> test(v); return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/1.cc index 10d0bf5667d..10d0bf5667d 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/1.cc diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc new file mode 100644 index 00000000000..13e9e37c3dd --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/2.cc @@ -0,0 +1,27 @@ +// { 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_set> +#include <testsuite_hooks.h> +#include <testsuite_api.h> + +template class std::unordered_set<__gnu_test::NonDefaultConstructible>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc new file mode 100644 index 00000000000..7d84ffd7fdc --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/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_set> + +using namespace std; +template class unordered_set<int, hash<int>, equal_to<int>, allocator<char>>; diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc index 4ebcb539029..86983e5a611 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/typedefs.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/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,26 +18,8 @@ // with this library; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +#include <testsuite_containers.h> #include <unordered_set> -void test01() -{ - // Check for required typedefs - typedef std::unordered_set<int> test_type; - - typedef test_type::key_type key_type; - typedef test_type::value_type value_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_set<int> > t; diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc index b5eaebb6525..9f4783b7439 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/citerators.cc @@ -19,26 +19,12 @@ // 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(7); - VERIFY( vb.cbegin() == vb.begin() ); - VERIFY( vb.cend() == vb.end() ); - VERIFY( vb.crbegin() == vb.rbegin() ); - VERIFY( vb.crend() == vb.rend() ); - VERIFY( vb.cbegin() != vb.cend() ); - VERIFY( vb.crbegin() != vb.crend() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::vector<bool> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/bool/constructor.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc index 9a815ec7dec..9a815ec7dec 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/bool/constructor.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/requirements/dr438/constructor.cc diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc index c9a07a1ed75..eee16b04ed6 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/citerators.cc @@ -19,26 +19,12 @@ // 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<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() ); -} +#include <testsuite_containers.h> int main() { - test01(); + typedef std::vector<int> test_type; + __gnu_test::citerator<test_type> test; return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/typedefs.cc new file mode 100644 index 00000000000..24897ff3aea --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/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 +// <http://www.gnu.org/licenses/>. + +#include <testsuite_containers.h> +#include <vector> + +// Check container for required typedefs. +__gnu_test::types<std::vector<int> > t; |