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 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: c++98, c++03
14 // vector& operator=(vector&& c);
19 #include "test_allocator.h"
20 #include "min_allocator.h"
21 #include "asan_testing.h"
26 std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
27 std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
28 for (int i = 1; i <= 3; ++i)
33 assert(is_contiguous_container_asan_correct(l));
34 assert(is_contiguous_container_asan_correct(lo));
35 std::vector<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(5));
39 assert(l2.get_allocator() == lo.get_allocator());
40 assert(is_contiguous_container_asan_correct(l2));
43 std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
44 std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
45 assert(is_contiguous_container_asan_correct(l));
46 assert(is_contiguous_container_asan_correct(lo));
47 for (int i = 1; i <= 3; ++i)
52 assert(is_contiguous_container_asan_correct(l));
53 assert(is_contiguous_container_asan_correct(lo));
54 std::vector<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(6));
58 assert(l2.get_allocator() == test_allocator<MoveOnly>(6));
59 assert(is_contiguous_container_asan_correct(l2));
62 std::vector<MoveOnly, other_allocator<MoveOnly> > l(other_allocator<MoveOnly>(5));
63 std::vector<MoveOnly, other_allocator<MoveOnly> > lo(other_allocator<MoveOnly>(5));
64 assert(is_contiguous_container_asan_correct(l));
65 assert(is_contiguous_container_asan_correct(lo));
66 for (int i = 1; i <= 3; ++i)
71 assert(is_contiguous_container_asan_correct(l));
72 assert(is_contiguous_container_asan_correct(lo));
73 std::vector<MoveOnly, other_allocator<MoveOnly> > l2(other_allocator<MoveOnly>(6));
77 assert(l2.get_allocator() == lo.get_allocator());
78 assert(is_contiguous_container_asan_correct(l2));
81 std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
82 std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
83 assert(is_contiguous_container_asan_correct(l));
84 assert(is_contiguous_container_asan_correct(lo));
85 for (int i = 1; i <= 3; ++i)
90 assert(is_contiguous_container_asan_correct(l));
91 assert(is_contiguous_container_asan_correct(lo));
92 std::vector<MoveOnly, min_allocator<MoveOnly> > l2(min_allocator<MoveOnly>{});
96 assert(l2.get_allocator() == lo.get_allocator());
97 assert(is_contiguous_container_asan_correct(l2));