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 push_front(const value_type& v);
18 #include "min_allocator.h"
22 make(int size, int start = 0 )
24 const int b = 4096 / sizeof(int);
28 init = (start+1) / b + ((start+1) % b != 0);
33 for (int i = 0; i < init-start; ++i)
35 for (int i = 0; i < size; ++i)
37 for (int i = 0; i < start; ++i)
46 typedef typename C::iterator I;
47 std::size_t c1_osize = c1.size();
49 assert(c1.size() == c1_osize + 1);
50 assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
54 for (int j = 0; static_cast<std::size_t>(j) < c1_osize; ++j, ++i)
60 testN(int start, int N)
62 C c1 = make<C>(N, start);
69 int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
70 const int N = sizeof(rng)/sizeof(rng[0]);
71 for (int i = 0; i < N; ++i)
72 for (int j = 0; j < N; ++j)
73 testN<std::deque<int> >(rng[i], rng[j]);
75 #if TEST_STD_VER >= 11
77 int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
78 const int N = sizeof(rng)/sizeof(rng[0]);
79 for (int i = 0; i < N; ++i)
80 for (int j = 0; j < N; ++j)
81 testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);