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 shrink_to_fit();
16 #include "../../../stack_allocator.h"
17 #include "min_allocator.h"
18 #include "asan_testing.h"
23 std::vector<int> v(100);
25 assert(is_contiguous_container_asan_correct(v));
27 assert(v.capacity() == 101);
28 assert(v.size() == 101);
29 assert(is_contiguous_container_asan_correct(v));
32 std::vector<int, stack_allocator<int, 401> > v(100);
34 assert(is_contiguous_container_asan_correct(v));
36 assert(v.capacity() == 101);
37 assert(v.size() == 101);
38 assert(is_contiguous_container_asan_correct(v));
40 #ifndef _LIBCPP_NO_EXCEPTIONS
42 std::vector<int, stack_allocator<int, 400> > v(100);
44 assert(is_contiguous_container_asan_correct(v));
46 assert(v.capacity() == 200);
47 assert(v.size() == 101);
48 assert(is_contiguous_container_asan_correct(v));
51 #if __cplusplus >= 201103L
53 std::vector<int, min_allocator<int>> v(100);
55 assert(is_contiguous_container_asan_correct(v));
57 assert(v.capacity() == 101);
58 assert(v.size() == 101);
59 assert(is_contiguous_container_asan_correct(v));