[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multimap / empty.pass.cpp
blob6189b7f0e3dedcd89794ae920196fb8a585b7d6f
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // <unordered_map>
11 // class unordered_multimap
13 // bool empty() const noexcept;
15 #include <unordered_map>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "min_allocator.h"
21 int main(int, char**)
24 typedef std::unordered_multimap<int, double> M;
25 M m;
26 ASSERT_NOEXCEPT(m.empty());
27 assert(m.empty());
28 m.insert(M::value_type(1, 1.5));
29 assert(!m.empty());
30 m.clear();
31 assert(m.empty());
33 #if TEST_STD_VER >= 11
35 typedef std::unordered_multimap<int, double, std::hash<int>, std::equal_to<int>, min_allocator<std::pair<const int, double>>> M;
36 M m;
37 ASSERT_NOEXCEPT(m.empty());
38 assert(m.empty());
39 m.insert(M::value_type(1, 1.5));
40 assert(!m.empty());
41 m.clear();
42 assert(m.empty());
44 #endif
46 return 0;