summaryrefslogtreecommitdiffstats
path: root/libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp')
-rw-r--r--libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp b/libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp
index 3b473508346..70a4e00b0d6 100644
--- a/libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp
+++ b/libcxx/test/thread/futures/futures.promise/alloc_ctor.pass.cpp
@@ -20,6 +20,7 @@
#include <cassert>
#include "../test_allocator.h"
+#include "min_allocator.h"
int main()
{
@@ -48,4 +49,36 @@ int main()
assert(f.valid());
}
assert(test_alloc_base::count == 0);
+ // Test with a minimal allocator
+ {
+ std::promise<int> p(std::allocator_arg, bare_allocator<void>());
+ std::future<int> f = p.get_future();
+ assert(f.valid());
+ }
+ {
+ std::promise<int&> p(std::allocator_arg, bare_allocator<void>());
+ std::future<int&> f = p.get_future();
+ assert(f.valid());
+ }
+ {
+ std::promise<void> p(std::allocator_arg, bare_allocator<void>());
+ std::future<void> f = p.get_future();
+ assert(f.valid());
+ }
+ // Test with a minimal allocator that returns class-type pointers
+ {
+ std::promise<int> p(std::allocator_arg, min_allocator<void>());
+ std::future<int> f = p.get_future();
+ assert(f.valid());
+ }
+ {
+ std::promise<int&> p(std::allocator_arg, min_allocator<void>());
+ std::future<int&> f = p.get_future();
+ assert(f.valid());
+ }
+ {
+ std::promise<void> p(std::allocator_arg, min_allocator<void>());
+ std::future<void> f = p.get_future();
+ assert(f.valid());
+ }
}
OpenPOWER on IntegriCloud