1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // deque(const deque& c, const allocator_type& a);
13 #include "asan_testing.h"
17 #include "test_macros.h"
18 #include "test_allocator.h"
19 #include "min_allocator.h"
23 test(const C
& x
, const typename
C::allocator_type
& a
)
27 assert(c
.get_allocator() == a
);
28 LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c
));
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>());