1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-exceptions
10 // UNSUPPORTED: libcpp-has-no-threads
22 #include "test_macros.h"
23 #include "test_allocator.h"
27 assert(test_alloc_base::alloc_count
== 0);
32 std::promise
<T
> p(std::allocator_arg
, test_allocator
<T
>());
33 assert(test_alloc_base::alloc_count
== 1);
35 assert(test_alloc_base::alloc_count
== 1);
38 assert(test_alloc_base::alloc_count
== 1);
41 assert(test_alloc_base::alloc_count
== 0);
46 std::promise
<T
> p(std::allocator_arg
, test_allocator
<int>());
47 assert(test_alloc_base::alloc_count
== 1);
49 assert(test_alloc_base::alloc_count
== 1);
52 assert(test_alloc_base::alloc_count
== 1);
55 assert(test_alloc_base::alloc_count
== 0);
60 std::promise
<T
> p(std::allocator_arg
, test_allocator
<T
>());
61 assert(test_alloc_base::alloc_count
== 1);
63 assert(test_alloc_base::alloc_count
== 1);
66 assert(test_alloc_base::alloc_count
== 1);
69 assert(test_alloc_base::alloc_count
== 0);