2 // { dg-options "-std=gnu++11 -g" }
4 // Copyright (C) 2011, 2012 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
21 #include <forward_list>
22 #include <unordered_map>
23 #include <unordered_set>
29 placeholder(const T &s)
34 template<class T, class S>
36 placeholder(const std::pair<T,S> &s)
43 use(const T &container)
45 for (typename T::const_iterator i = container.begin();
54 std::forward_list<int> efl;
55 // { dg-final { note-test efl "empty std::forward_list" } }
57 std::forward_list<int> fl;
60 // { dg-final { note-test fl {std::forward_list = {[0] = 1, [1] = 2}} } }
62 std::unordered_map<int, std::string> eum;
63 // { dg-final { note-test eum "std::unordered_map with 0 elements" } }
64 std::unordered_multimap<int, std::string> eumm;
65 // { dg-final { note-test eumm "std::unordered_multimap with 0 elements" } }
66 std::unordered_set<int> eus;
67 // { dg-final { note-test eus "std::unordered_set with 0 elements" } }
68 std::unordered_multiset<int> eums;
69 // { dg-final { note-test eums "std::unordered_multiset with 0 elements" } }
71 std::unordered_map<int, std::string> uom;
74 // { dg-final { note-test uom {std::unordered_map with 2 elements = {[3] = "seven", [5] = "three"}} } }
76 std::unordered_multimap<int, std::string> uomm;
77 uomm.insert(std::pair<int, std::string> (5, "three"));
78 uomm.insert(std::pair<int, std::string> (5, "seven"));
79 // { dg-final { note-test uomm {std::unordered_multimap with 2 elements = {[5] = "seven", [5] = "three"}} } }
81 std::unordered_set<int> uos;
83 // { dg-final { note-test uos {std::unordered_set with 1 elements = {[0] = 5}} } }
85 std::unordered_multiset<int> uoms;
87 // { dg-final { note-test uoms {std::unordered_multiset with 1 elements = {[0] = 5}} } }
89 placeholder(""); // Mark SPOT
100 // { dg-final { gdb-test SPOT } }