[X86] Better handling of impossibly large stack frames (#124217)
[llvm-project.git] / libcxx / test / std / containers / associative / multiset / multiset.cons / initializer_list.pass.cpp
blobfa4a85e20f82af3686b411383d9a20d9546465ea
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 multiset
15 // multiset(initializer_list<value_type> il, const key_compare& comp = key_compare());
17 #include <set>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "min_allocator.h"
23 int main(int, char**)
26 typedef std::multiset<int> C;
27 typedef C::value_type V;
28 C m = {1, 2, 3, 4, 5, 6};
29 assert(m.size() == 6);
30 assert(std::distance(m.begin(), m.end()) == 6);
31 C::const_iterator i = m.cbegin();
32 assert(*i == V(1));
33 assert(*++i == V(2));
34 assert(*++i == V(3));
35 assert(*++i == V(4));
36 assert(*++i == V(5));
37 assert(*++i == V(6));
40 typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
41 typedef C::value_type V;
42 C m = {1, 2, 3, 4, 5, 6};
43 assert(m.size() == 6);
44 assert(std::distance(m.begin(), m.end()) == 6);
45 C::const_iterator i = m.cbegin();
46 assert(*i == V(1));
47 assert(*++i == V(2));
48 assert(*++i == V(3));
49 assert(*++i == V(4));
50 assert(*++i == V(5));
51 assert(*++i == V(6));
54 typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
55 typedef C::value_type V;
56 min_allocator<int> a;
57 C m ({1, 2, 3, 4, 5, 6}, a);
58 assert(m.size() == 6);
59 assert(std::distance(m.begin(), m.end()) == 6);
60 C::const_iterator i = m.cbegin();
61 assert(*i == V(1));
62 assert(*++i == V(2));
63 assert(*++i == V(3));
64 assert(*++i == V(4));
65 assert(*++i == V(5));
66 assert(*++i == V(6));
67 assert(m.get_allocator() == a);
70 return 0;