[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / associative / set / insert_iter_rv.pass.cpp
blob5ce5182b868f9a8061bb799a271fc011efde58bb
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 // UNSUPPORTED: c++03
11 // <set>
13 // class set
15 // iterator insert(const_iterator position, value_type&& v);
17 #include <set>
18 #include <cassert>
19 #include <iterator>
21 #include "test_macros.h"
22 #include "MoveOnly.h"
23 #include "min_allocator.h"
25 int main(int, char**)
28 typedef std::set<MoveOnly> M;
29 typedef M::iterator R;
30 M m;
31 R r = m.insert(m.cend(), M::value_type(2));
32 assert(r == m.begin());
33 assert(m.size() == 1);
34 assert(*r == 2);
36 r = m.insert(m.cend(), M::value_type(1));
37 assert(r == m.begin());
38 assert(m.size() == 2);
39 assert(*r == 1);
41 r = m.insert(m.cend(), M::value_type(3));
42 assert(r == std::prev(m.end()));
43 assert(m.size() == 3);
44 assert(*r == 3);
46 r = m.insert(m.cend(), M::value_type(3));
47 assert(r == std::prev(m.end()));
48 assert(m.size() == 3);
49 assert(*r == 3);
52 typedef std::set<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M;
53 typedef M::iterator R;
54 M m;
55 R r = m.insert(m.cend(), M::value_type(2));
56 assert(r == m.begin());
57 assert(m.size() == 1);
58 assert(*r == 2);
60 r = m.insert(m.cend(), M::value_type(1));
61 assert(r == m.begin());
62 assert(m.size() == 2);
63 assert(*r == 1);
65 r = m.insert(m.cend(), M::value_type(3));
66 assert(r == std::prev(m.end()));
67 assert(m.size() == 3);
68 assert(*r == 3);
70 r = m.insert(m.cend(), M::value_type(3));
71 assert(r == std::prev(m.end()));
72 assert(m.size() == 3);
73 assert(*r == 3);
76 return 0;