[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / associative / set / set.cons / iter_iter_alloc.pass.cpp
blob2cdad2adab174b574b311fdfca2ff8ecd1ec9b11
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 // <set>
11 // class set
13 // template <class InputIterator>
14 // set(InputIterator first, InputIterator last,
15 // const value_compare& comp, const allocator_type& a);
17 // template <class InputIterator>
18 // set(InputIterator first, InputIterator last,
19 // const allocator_type& a);
21 #include <set>
22 #include <cassert>
24 #include "test_macros.h"
25 #include "test_iterators.h"
26 #include "../../../test_compare.h"
27 #include "test_allocator.h"
29 int main(int, char**)
32 typedef int V;
33 V ar[] =
45 typedef test_less<V> C;
46 typedef test_allocator<V> A;
47 std::set<V, C, A> m(cpp17_input_iterator<const V*>(ar),
48 cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
49 C(5), A(7));
50 assert(m.value_comp() == C(5));
51 assert(m.get_allocator() == A(7));
52 assert(m.size() == 3);
53 assert(std::distance(m.begin(), m.end()) == 3);
54 assert(*m.begin() == 1);
55 assert(*std::next(m.begin()) == 2);
56 assert(*std::next(m.begin(), 2) == 3);
58 #if TEST_STD_VER > 11
60 typedef int V;
61 V ar[] =
73 typedef test_allocator<V> A;
74 typedef test_less<int> C;
75 A a(7);
76 std::set<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
78 assert(m.size() == 3);
79 assert(std::distance(m.begin(), m.end()) == 3);
80 assert(*m.begin() == 1);
81 assert(*std::next(m.begin()) == 2);
82 assert(*std::next(m.begin(), 2) == 3);
83 assert(m.get_allocator() == a);
85 #endif
87 return 0;