[RISCV] Add a default assignment of Inst{12-7} to RVInst16CSS. NFC
[llvm-project.git] / libcxx / test / std / containers / associative / multimap / multimap.cons / initializer_list.pass.cpp
blob1c679778941c226f32d237385125dad032993991
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 // <map>
13 // class multimap
15 // multimap(initializer_list<value_type> il, const key_compare& comp = key_compare());
17 #include <map>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "min_allocator.h"
23 int main(int, char**)
26 typedef std::multimap<int, double> C;
27 typedef C::value_type V;
28 C m =
30 {1, 1},
31 {1, 1.5},
32 {1, 2},
33 {2, 1},
34 {2, 1.5},
35 {2, 2},
36 {3, 1},
37 {3, 1.5},
38 {3, 2}
40 assert(m.size() == 9);
41 assert(std::distance(m.begin(), m.end()) == 9);
42 C::const_iterator i = m.cbegin();
43 assert(*i == V(1, 1));
44 assert(*++i == V(1, 1.5));
45 assert(*++i == V(1, 2));
46 assert(*++i == V(2, 1));
47 assert(*++i == V(2, 1.5));
48 assert(*++i == V(2, 2));
49 assert(*++i == V(3, 1));
50 assert(*++i == V(3, 1.5));
51 assert(*++i == V(3, 2));
54 typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
55 typedef C::value_type V;
56 C m =
58 {1, 1},
59 {1, 1.5},
60 {1, 2},
61 {2, 1},
62 {2, 1.5},
63 {2, 2},
64 {3, 1},
65 {3, 1.5},
66 {3, 2}
68 assert(m.size() == 9);
69 assert(std::distance(m.begin(), m.end()) == 9);
70 C::const_iterator i = m.cbegin();
71 assert(*i == V(1, 1));
72 assert(*++i == V(1, 1.5));
73 assert(*++i == V(1, 2));
74 assert(*++i == V(2, 1));
75 assert(*++i == V(2, 1.5));
76 assert(*++i == V(2, 2));
77 assert(*++i == V(3, 1));
78 assert(*++i == V(3, 1.5));
79 assert(*++i == V(3, 2));
82 return 0;