[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multiset / bucket_count.pass.cpp
blob8f389ebc206ba2eea525666f613907099848fe85
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_set>
11 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
12 // class Alloc = allocator<Value>>
13 // class unordered_multiset
15 // size_type bucket_count() const;
17 #include <unordered_set>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "min_allocator.h"
23 int main(int, char**)
26 typedef std::unordered_multiset<int> C;
27 const C c;
28 LIBCPP_ASSERT(c.bucket_count() == 0);
31 typedef std::unordered_multiset<int> C;
32 typedef int P;
33 P a[] =
35 P(10),
36 P(20),
37 P(30),
38 P(40),
39 P(50),
40 P(60),
41 P(70),
42 P(80)
44 const C c(std::begin(a), std::end(a));
45 assert(c.bucket_count() >= 8);
47 #if TEST_STD_VER >= 11
49 typedef std::unordered_multiset<int, std::hash<int>,
50 std::equal_to<int>, min_allocator<int>> C;
51 const C c;
52 LIBCPP_ASSERT(c.bucket_count() == 0);
55 typedef std::unordered_multiset<int, std::hash<int>,
56 std::equal_to<int>, min_allocator<int>> C;
57 typedef int P;
58 P a[] =
60 P(10),
61 P(20),
62 P(30),
63 P(40),
64 P(50),
65 P(60),
66 P(70),
67 P(80)
69 const C c(std::begin(a), std::end(a));
70 assert(c.bucket_count() >= 8);
72 #endif
74 return 0;