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 //===----------------------------------------------------------------------===//
17 #include "min_allocator.h"
18 #include "asan_testing.h"
22 Nasty(int i) : i_(i) {}
25 Nasty * operator&() const { assert(false); return nullptr; }
33 assert(v.data() == 0);
34 assert(is_contiguous_container_asan_correct(v));
37 std::vector<int> v(100);
38 assert(v.data() == std::addressof(v.front()));
39 assert(is_contiguous_container_asan_correct(v));
42 std::vector<Nasty> v(100);
43 assert(v.data() == std::addressof(v.front()));
44 assert(is_contiguous_container_asan_correct(v));
46 #if TEST_STD_VER >= 11
48 std::vector<int, min_allocator<int>> v;
49 assert(v.data() == 0);
50 assert(is_contiguous_container_asan_correct(v));
53 std::vector<int, min_allocator<int>> v(100);
54 assert(v.data() == std::addressof(v.front()));
55 assert(is_contiguous_container_asan_correct(v));
58 std::vector<Nasty, min_allocator<Nasty>> v(100);
59 assert(v.data() == std::addressof(v.front()));
60 assert(is_contiguous_container_asan_correct(v));