OpenMP: Fix typo in atomic directive error message
[gcc.git] / libstdc++-v3 / testsuite / 23_containers / unordered_multimap / 96088.cc
blob6f9429610775e95d92a388c8a9b54eec4b435205
1 // { dg-do run { target c++17 } }
2 // { dg-require-effective-target std_allocator_new }
3 // { dg-xfail-run-if "AIX operator new" { powerpc-ibm-aix* } }
5 // Copyright (C) 2021-2025 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
22 // libstdc++/96088
24 #include <string_view>
25 #include <string>
26 #include <unordered_map>
28 #include <testsuite_hooks.h>
29 #include <replacement_memory_operators.h>
31 static constexpr std::initializer_list<std::pair<const char*, const char*>> lst =
32 { { "long_str_for_dynamic_allocation", "long_str_for_dynamic_allocation" } };
34 void
35 test01()
37 __gnu_test::counter::reset();
38 std::unordered_multimap<std::string, std::string,
39 std::hash<std::string_view>,
40 std::equal_to<std::string_view>> foo;
41 foo.insert(lst.begin(), lst.end());
42 VERIFY( foo.size() == 1 );
44 VERIFY( __gnu_test::counter::count() == 4 );
45 VERIFY( __gnu_test::counter::get()._M_increments == 4 );
48 void
49 test02()
51 __gnu_test::counter::reset();
52 std::unordered_multimap<std::string, std::string> foo;
53 foo.insert(lst.begin(), lst.end());
54 VERIFY( foo.size() == 1 );
56 VERIFY( __gnu_test::counter::count() == 4 );
57 VERIFY( __gnu_test::counter::get()._M_increments == 4 );
60 int
61 main()
63 __gnu_test::counter::scope s;
64 test01();
65 test02();
66 return 0;