[AMDGPU] Implement IR variant of isFMAFasterThanFMulAndFAdd (#121465)
[llvm-project.git] / libcxx / test / std / containers / associative / multiset / multiset.cons / iter_iter_alloc.pass.cpp
blobdcc7e0dd2cc07a76b7f6253c12a00ec46770cc60
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 multiset
13 // template <class InputIterator>
14 // multiset(InputIterator first, InputIterator last,
15 // const value_compare& comp, const allocator_type& a);
17 #include <set>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "test_iterators.h"
22 #include "../../../test_compare.h"
23 #include "test_allocator.h"
25 int main(int, char**)
28 typedef int V;
29 V ar[] =
41 typedef test_less<V> C;
42 typedef test_allocator<V> A;
43 std::multiset<V, C, A> m(cpp17_input_iterator<const V*>(ar),
44 cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])),
45 C(5), A(7));
46 assert(m.value_comp() == C(5));
47 assert(m.get_allocator() == A(7));
48 assert(m.size() == 9);
49 assert(std::distance(m.begin(), m.end()) == 9);
50 assert(*std::next(m.begin(), 0) == 1);
51 assert(*std::next(m.begin(), 1) == 1);
52 assert(*std::next(m.begin(), 2) == 1);
53 assert(*std::next(m.begin(), 3) == 2);
54 assert(*std::next(m.begin(), 4) == 2);
55 assert(*std::next(m.begin(), 5) == 2);
56 assert(*std::next(m.begin(), 6) == 3);
57 assert(*std::next(m.begin(), 7) == 3);
58 assert(*std::next(m.begin(), 8) == 3);
60 #if TEST_STD_VER > 11
62 typedef int V;
63 V ar[] =
75 typedef test_allocator<V> A;
76 typedef test_less<int> C;
77 A a;
78 std::multiset<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
80 assert(m.size() == 9);
81 assert(std::distance(m.begin(), m.end()) == 9);
82 assert(*std::next(m.begin(), 0) == 1);
83 assert(*std::next(m.begin(), 1) == 1);
84 assert(*std::next(m.begin(), 2) == 1);
85 assert(*std::next(m.begin(), 3) == 2);
86 assert(*std::next(m.begin(), 4) == 2);
87 assert(*std::next(m.begin(), 5) == 2);
88 assert(*std::next(m.begin(), 6) == 3);
89 assert(*std::next(m.begin(), 7) == 3);
90 assert(*std::next(m.begin(), 8) == 3);
91 assert(m.get_allocator() == a);
93 #endif
95 return 0;