[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / unord / unord.multiset / iterators.compile.fail.cpp
blob2c282fdbaab4bfb67b9c2be0d931e09aea038977
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 // iterator begin() {return __table_.begin();}
16 // iterator end() {return __table_.end();}
17 // const_iterator begin() const {return __table_.begin();}
18 // const_iterator end() const {return __table_.end();}
19 // const_iterator cbegin() const {return __table_.begin();}
20 // const_iterator cend() const {return __table_.end();}
22 #include <unordered_set>
23 #include <cassert>
25 #include "test_macros.h"
27 int main(int, char**)
30 typedef std::unordered_multiset<int> C;
31 typedef int P;
32 P a[] =
34 P(1),
35 P(2),
36 P(3),
37 P(4),
38 P(1),
39 P(2)
41 C c(a, a + sizeof(a)/sizeof(a[0]));
42 LIBCPP_ASSERT(c.bucket_count() == 7);
43 assert(c.size() == 6);
44 assert(std::distance(c.begin(), c.end()) == c.size());
45 assert(std::distance(c.cbegin(), c.cend()) == c.size());
46 C::iterator i = c.begin();
47 assert(*i == 1);
48 *i = 2;
51 typedef std::unordered_multiset<int> C;
52 typedef int P;
53 P a[] =
55 P(1),
56 P(2),
57 P(3),
58 P(4),
59 P(1),
60 P(2)
62 const C c(a, a + sizeof(a)/sizeof(a[0]));
63 LIBCPP_ASSERT(c.bucket_count() == 7);
64 assert(c.size() == 6);
65 assert(std::distance(c.begin(), c.end()) == c.size());
66 assert(std::distance(c.cbegin(), c.cend()) == c.size());
69 return 0;