[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / deque / deque.cons / copy_alloc.pass.cpp
blob3fdfcc3405f0e3098a2427cdd44910470883fa68
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 // <deque>
11 // deque(const deque& c, const allocator_type& a);
13 #include "asan_testing.h"
14 #include <deque>
15 #include <cassert>
17 #include "test_macros.h"
18 #include "test_allocator.h"
19 #include "min_allocator.h"
21 template <class C>
22 void
23 test(const C& x, const typename C::allocator_type& a)
25 C c(x, a);
26 assert(c == x);
27 assert(c.get_allocator() == a);
28 LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c));
31 int main(int, char**)
34 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
35 int* an = ab + sizeof(ab)/sizeof(ab[0]);
36 test(std::deque<int, test_allocator<int> >(ab, an, test_allocator<int>(3)),
37 test_allocator<int>(4));
40 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
41 int* an = ab + sizeof(ab)/sizeof(ab[0]);
42 test(std::deque<int, other_allocator<int> >(ab, an, other_allocator<int>(3)),
43 other_allocator<int>(4));
45 #if TEST_STD_VER >= 11
47 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
48 int* an = ab + sizeof(ab)/sizeof(ab[0]);
49 test(std::deque<int, min_allocator<int> >(ab, an, min_allocator<int>()),
50 min_allocator<int>());
53 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
54 int* an = ab + sizeof(ab)/sizeof(ab[0]);
55 test(std::deque<int, safe_allocator<int> >(ab, an, safe_allocator<int>()),
56 safe_allocator<int>());
58 #endif
60 return 0;