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 // void push_back(const value_type& v);
15 #include "asan_testing.h"
19 #include "test_macros.h"
20 #include "min_allocator.h"
24 make(int size
, int start
= 0 )
26 const int b
= 4096 / sizeof(int);
30 init
= (start
+1) / b
+ ((start
+1) % b
!= 0);
35 for (int i
= 0; i
< init
-start
; ++i
)
37 for (int i
= 0; i
< size
; ++i
)
39 for (int i
= 0; i
< start
; ++i
)
47 int rng
[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049};
48 const int N
= sizeof(rng
)/sizeof(rng
[0]);
49 for (int j
= 0; j
< N
; ++j
)
51 C c
= make
<C
>(size
, rng
[j
]);
52 typename
C::const_iterator it
= c
.begin();
53 LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(c
));
54 for (int i
= 0; i
< size
; ++i
, ++it
)
62 int rng
[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
63 const int N
= sizeof(rng
)/sizeof(rng
[0]);
64 for (int j
= 0; j
< N
; ++j
)
65 test
<std::deque
<int> >(rng
[j
]);
67 #if TEST_STD_VER >= 11
69 int rng
[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
70 const int N
= sizeof(rng
)/sizeof(rng
[0]);
71 for (int j
= 0; j
< N
; ++j
)
72 test
<std::deque
<int, min_allocator
<int>> >(rng
[j
]);