[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / containers / sequences / vector.bool / shrink_to_fit.pass.cpp
blobb39245cab7bf43fa6d033f12f288d1211a251f50
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 shrink_to_fit();
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(100);
24 v.push_back(1);
25 v.shrink_to_fit();
26 assert(v.capacity() >= 101);
27 assert(v.size() >= 101);
29 #if TEST_STD_VER >= 11
31 std::vector<bool, min_allocator<bool>> v(100);
32 v.push_back(1);
33 v.shrink_to_fit();
34 assert(v.capacity() >= 101);
35 assert(v.size() >= 101);
37 #endif
39 return true;
42 int main(int, char**)
44 tests();
45 #if TEST_STD_VER > 17
46 static_assert(tests());
47 #endif
48 return 0;