1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // void reserve(size_type n);
16 #include "../../../stack_allocator.h"
17 #include "min_allocator.h"
18 #include "asan_testing.h"
25 assert(v.capacity() >= 10);
26 assert(is_contiguous_container_asan_correct(v));
29 std::vector<int> v(100);
30 assert(v.capacity() == 100);
32 assert(v.size() == 100);
33 assert(v.capacity() == 100);
35 assert(v.size() == 100);
36 assert(v.capacity() == 150);
37 assert(is_contiguous_container_asan_correct(v));
40 std::vector<int, stack_allocator<int, 250> > v(100);
41 assert(v.capacity() == 100);
43 assert(v.size() == 100);
44 assert(v.capacity() == 100);
46 assert(v.size() == 100);
47 assert(v.capacity() == 150);
48 assert(is_contiguous_container_asan_correct(v));
50 #if __cplusplus >= 201103L
52 std::vector<int, min_allocator<int>> v;
54 assert(v.capacity() >= 10);
55 assert(is_contiguous_container_asan_correct(v));
58 std::vector<int, min_allocator<int>> v(100);
59 assert(v.capacity() == 100);
61 assert(v.size() == 100);
62 assert(v.capacity() == 100);
64 assert(v.size() == 100);
65 assert(v.capacity() == 150);
66 assert(is_contiguous_container_asan_correct(v));