[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / reserve.pass.cpp
blob23bd49d9730ede0c90dd45f7f49677cd1d583881
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>
10 // vector<bool>
12 // void reserve(size_type n);
14 #include <vector>
15 #include <cassert>
17 #include "test_macros.h"
18 #include "min_allocator.h"
20 int main(int, char**)
23 std::vector<bool> v;
24 v.reserve(10);
25 assert(v.capacity() >= 10);
28 std::vector<bool> v(100);
29 assert(v.capacity() >= 100);
30 v.reserve(50);
31 assert(v.size() == 100);
32 assert(v.capacity() >= 100);
33 v.reserve(150);
34 assert(v.size() == 100);
35 assert(v.capacity() >= 150);
37 #if TEST_STD_VER >= 11
39 std::vector<bool, min_allocator<bool>> v;
40 v.reserve(10);
41 assert(v.capacity() >= 10);
44 std::vector<bool, min_allocator<bool>> v(100);
45 assert(v.capacity() >= 100);
46 v.reserve(50);
47 assert(v.size() == 100);
48 assert(v.capacity() >= 100);
49 v.reserve(150);
50 assert(v.size() == 100);
51 assert(v.capacity() >= 150);
53 #endif
55 return 0;