Index: libcxx/test/std/containers/associative/map/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/map/get_allocator.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class map + +// allocator_type get_allocator() const + +#include +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator > alloc; + const std::map m(alloc); + assert(m.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator > alloc(1); + const std::map, + other_allocator>> m(alloc); + assert(m.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/associative/multimap/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/multimap/get_allocator.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class multimap + +// allocator_type get_allocator() const + +#include +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator > alloc; + const std::multimap m(alloc); + assert(m.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator > alloc(1); + const std::multimap, + other_allocator>> m(alloc); + assert(m.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/associative/multiset/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/multiset/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class multiset + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::multiset s(alloc); + assert(s.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::multiset, other_allocator> s(alloc); + assert(s.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/associative/set/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/associative/set/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class set + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::set s(alloc); + assert(s.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::set, other_allocator> s(alloc); + assert(s.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/deque/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class deque + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::deque d(alloc); + assert(d.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::deque > d(alloc); + assert(d.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/sequences/forwardlist/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/forwardlist/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class forward_list + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::forward_list fl(alloc); + assert(fl.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::forward_list> fl(alloc); + assert(fl.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/sequences/list/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/list/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class list + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::list l(alloc); + assert(l.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::list> l(alloc); + assert(l.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/sequences/vector.bool/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/vector.bool/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class vector + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::vector vb(alloc); + assert(vb.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::vector> vb(alloc); + assert(vb.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/sequences/vector/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/sequences/vector/get_allocator.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class vector + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::vector vb(alloc); + assert(vb.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::vector> vb(alloc); + assert(vb.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/unord/unord.map/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/unord/unord.map/get_allocator.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class unordered_map + +// allocator_type get_allocator() const + +#include +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator > alloc; + const std::unordered_map m(alloc); + assert(m.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator> alloc(1); + const std::unordered_map, + std::equal_to, + other_allocator>> m(alloc); + assert(m.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/unord/unord.multimap/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/unord/unord.multimap/get_allocator.pass.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class unordered_multimap + +// allocator_type get_allocator() const + +#include +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator > alloc; + const std::unordered_multimap m(alloc); + assert(m.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator> alloc(1); + const std::unordered_multimap, + std::equal_to, + other_allocator>> m(alloc); + assert(m.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/unord/unord.multiset/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/unord/unord.multiset/get_allocator.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class unordered_multiset + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::unordered_multiset s(alloc); + assert(s.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::unordered_multiset, + std::equal_to, + other_allocator> s(alloc); + assert(s.get_allocator() == alloc); + } +#endif + return 0; +} Index: libcxx/test/std/containers/unord/unord.set/get_allocator.pass.cpp =================================================================== --- /dev/null +++ libcxx/test/std/containers/unord/unord.set/get_allocator.pass.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// class unordered_set + +// allocator_type get_allocator() const + +#include +#include + +#include "test_allocator.h" +#include "test_macros.h" + +int main(int, char**) { + { + std::allocator alloc; + const std::unordered_set s(alloc); + assert(s.get_allocator() == alloc); + } +#if TEST_STD_VER >= 11 + { + other_allocator alloc(1); + const std::unordered_set, + std::equal_to, + other_allocator> s(alloc); + assert(s.get_allocator() == alloc); + } +#endif + return 0; +}