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 // iterator insert(const_iterator position, size_type n, const value_type& x);
14 // UNSUPPORTED: sanitizer-new-delete
20 #include "min_allocator.h"
21 #include "count_new.hpp"
22 #include "test_macros.h"
27 int a2[] = {1, 4, 4, 4, 4, 4, 2, 3};
29 typename List::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
30 assert(i == next(l1.begin()));
31 assert(l1 == List(a2, a2+8));
32 #ifndef TEST_HAS_NO_EXCEPTIONS
33 globalMemCounter.throw_after = 4;
34 int save_count = globalMemCounter.outstanding_new;
37 i = l1.insert(i, 5, 5);
43 assert(globalMemCounter.checkOutstandingNewEq(save_count));
44 assert(l1 == List(a2, a2+8));
50 test<std::list<int> >();
51 #if TEST_STD_VER >= 11
52 test<std::list<int, min_allocator<int>>>();