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 //===----------------------------------------------------------------------===//
12 // void push_back(const value_type& x);
18 #include "test_macros.h"
19 #include "min_allocator.h"
21 TEST_CONSTEXPR_CXX20
bool tests()
24 bool a
[] = {0, 1, 1, 0, 1, 0, 0};
25 const unsigned N
= sizeof(a
)/sizeof(a
[0]);
27 for (unsigned i
= 0; i
< N
; ++i
)
30 assert(c
.size() == i
+1);
31 for (std::size_t j
= 0; j
< c
.size(); ++j
)
35 #if TEST_STD_VER >= 11
37 bool a
[] = {0, 1, 1, 0, 1, 0, 0};
38 const unsigned N
= sizeof(a
)/sizeof(a
[0]);
39 std::vector
<bool, min_allocator
<bool>> c
;
40 for (unsigned i
= 0; i
< N
; ++i
)
43 assert(c
.size() == i
+1);
44 for (std::size_t j
= 0; j
< c
.size(); ++j
)
57 static_assert(tests());