[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / capacity.pass.cpp
blob986453a189049cbe03dc5d810ef26d52f0f269ca
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 // size_type capacity() const;
14 #include <vector>
15 #include <cassert>
17 #include "test_macros.h"
18 #include "min_allocator.h"
20 TEST_CONSTEXPR_CXX20 bool tests()
23 std::vector<bool> v;
24 assert(v.capacity() == 0);
27 std::vector<bool> v(100);
28 assert(v.capacity() >= 100);
29 v.push_back(0);
30 assert(v.capacity() >= 101);
32 #if TEST_STD_VER >= 11
34 std::vector<bool, min_allocator<bool>> v;
35 assert(v.capacity() == 0);
38 std::vector<bool, min_allocator<bool>> v(100);
39 assert(v.capacity() >= 100);
40 v.push_back(0);
41 assert(v.capacity() >= 101);
43 #endif
45 return true;
48 int main(int, char**)
50 tests();
51 #if TEST_STD_VER > 17
52 static_assert(tests());
53 #endif
54 return 0;