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 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03
10 
11 // Aligned allocation is required by std::experimental::pmr, but it was not provided
12 // before macosx10.13 and as a result we get linker errors when deploying to older than
13 // macosx10.13.
14 // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}}
15 
16 // <experimental/deque>
17 
18 // namespace std { namespace experimental { namespace pmr {
19 // template <class T>
20 // using deque =
21 //     ::std::deque<T, polymorphic_allocator<T>>
22 //
23 // }}} // namespace std::experimental::pmr
24 
25 #include <experimental/deque>
26 #include <experimental/memory_resource>
27 #include <type_traits>
28 #include <cassert>
29 
30 #include "test_macros.h"
31 
32 namespace pmr = std::experimental::pmr;
33 
main(int,char **)34 int main(int, char**)
35 {
36     using StdDeque = std::deque<int, pmr::polymorphic_allocator<int>>;
37     using PmrDeque = pmr::deque<int>;
38     static_assert(std::is_same<StdDeque, PmrDeque>::value, "");
39     PmrDeque d;
40     assert(d.get_allocator().resource() == pmr::get_default_resource());
41 
42   return 0;
43 }
44