[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / assign_copy.pass.cpp
blobc4866ea4c9b45d077c6f5dbe8f597f79334fd6d5
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 // <vector>
11 // vector& operator=(const vector& c);
13 #include <vector>
14 #include <cassert>
15 #include "test_macros.h"
16 #include "test_allocator.h"
17 #include "min_allocator.h"
19 TEST_CONSTEXPR_CXX20 bool tests()
22 std::vector<bool, test_allocator<bool> > l(3, true, test_allocator<bool>(5));
23 std::vector<bool, test_allocator<bool> > l2(l, test_allocator<bool>(3));
24 l2 = l;
25 assert(l2 == l);
26 assert(l2.get_allocator() == test_allocator<bool>(3));
29 std::vector<bool, other_allocator<bool> > l(3, true, other_allocator<bool>(5));
30 std::vector<bool, other_allocator<bool> > l2(l, other_allocator<bool>(3));
31 l2 = l;
32 assert(l2 == l);
33 assert(l2.get_allocator() == other_allocator<bool>(5));
35 #if TEST_STD_VER >= 11
37 std::vector<bool, min_allocator<bool> > l(3, true, min_allocator<bool>());
38 std::vector<bool, min_allocator<bool> > l2(l, min_allocator<bool>());
39 l2 = l;
40 assert(l2 == l);
41 assert(l2.get_allocator() == min_allocator<bool>());
43 #endif
45 return true;
48 int main(int, char**)
50 tests();
51 #if TEST_STD_VER > 17
52 static_assert(tests());
53 #endif
54 return 0;