summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-06-08 00:45:45 +0000
committerEric Fiselier <eric@efcs.ca>2019-06-08 00:45:45 +0000
commitcdff3806811de210abd0ea368364441a1eac2fa0 (patch)
tree3fb2364afc3d02fc8a37b4e25c6d00619e4a2c28
parentb359596d5ae02cd1249f6b629be343456fcaf68b (diff)
downloadbcm5719-llvm-cdff3806811de210abd0ea368364441a1eac2fa0.tar.gz
bcm5719-llvm-cdff3806811de210abd0ea368364441a1eac2fa0.zip
Fix some incorrect std::function tests
llvm-svn: 362861
-rw-r--r--libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
index 6fa0d6faeaf..bcc93adad10 100644
--- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
@@ -64,7 +64,9 @@ void test_FreeFunction(AllocType& alloc)
FuncType* target = &FreeFunction;
assert(globalMemCounter.checkOutstandingNewEq(0));
std::function<FuncType> f2(std::allocator_arg, alloc, target);
- assert(globalMemCounter.checkOutstandingNewEq(0));
+ // The allocator may not fit in the small object buffer, if we allocated
+ // check it was done via the allocator.
+ assert(globalMemCounter.checkOutstandingNewEq(test_alloc_base::alloc_count));
assert(f2.template target<FuncType*>());
assert(*f2.template target<FuncType*>() == target);
assert(f2.template target<FuncType>() == 0);
@@ -81,7 +83,7 @@ void test_MemFunClass(AllocType& alloc)
TargetType target = &MemFunClass::foo;
assert(globalMemCounter.checkOutstandingNewEq(0));
std::function<FuncType> f2(std::allocator_arg, alloc, target);
- assert(globalMemCounter.checkOutstandingNewEq(0));
+ assert(globalMemCounter.checkOutstandingNewEq(test_alloc_base::alloc_count));
assert(f2.template target<TargetType>());
assert(*f2.template target<TargetType>() == target);
assert(f2.template target<FuncType*>() == 0);
OpenPOWER on IntegriCloud