[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / deque / deque.cons / copy_alloc.pass.cpp
blob4e75ff72873e4a7fc9807dc04e7d6cb855dcf39f
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // <deque>
11 // deque(const deque& c, const allocator_type& a);
13 #include <deque>
14 #include <cassert>
16 #include "test_macros.h"
17 #include "test_allocator.h"
18 #include "min_allocator.h"
20 template <class C>
21 void
22 test(const C& x, const typename C::allocator_type& a)
24 C c(x, a);
25 assert(c == x);
26 assert(c.get_allocator() == a);
29 int main(int, char**)
32 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
33 int* an = ab + sizeof(ab)/sizeof(ab[0]);
34 test(std::deque<int, test_allocator<int> >(ab, an, test_allocator<int>(3)),
35 test_allocator<int>(4));
38 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
39 int* an = ab + sizeof(ab)/sizeof(ab[0]);
40 test(std::deque<int, other_allocator<int> >(ab, an, other_allocator<int>(3)),
41 other_allocator<int>(4));
43 #if TEST_STD_VER >= 11
45 int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
46 int* an = ab + sizeof(ab)/sizeof(ab[0]);
47 test(std::deque<int, min_allocator<int> >(ab, an, min_allocator<int>()),
48 min_allocator<int>());
50 #endif
52 return 0;