[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / vector / vector.capacity / capacity.pass.cpp
blob41d885f250e03ae174df920e487935e159c099ff
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>
11 // size_type capacity() const;
13 #include <vector>
14 #include <cassert>
16 #include "test_macros.h"
17 #include "min_allocator.h"
18 #include "asan_testing.h"
20 int main(int, char**)
23 std::vector<int> v;
24 assert(v.capacity() == 0);
25 assert(is_contiguous_container_asan_correct(v));
28 std::vector<int> v(100);
29 assert(v.capacity() == 100);
30 v.push_back(0);
31 assert(v.capacity() > 101);
32 assert(is_contiguous_container_asan_correct(v));
34 #if TEST_STD_VER >= 11
36 std::vector<int, min_allocator<int>> v;
37 assert(v.capacity() == 0);
38 assert(is_contiguous_container_asan_correct(v));
41 std::vector<int, min_allocator<int>> v(100);
42 assert(v.capacity() == 100);
43 v.push_back(0);
44 assert(v.capacity() > 101);
45 assert(is_contiguous_container_asan_correct(v));
47 #endif
49 return 0;