summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/memory
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-07-09 22:20:07 +0000
committerEric Fiselier <eric@efcs.ca>2017-07-09 22:20:07 +0000
commit52f2683695cf26bdf18f2b3d84292a11cbbe938a (patch)
tree89c5c162a26c501754336f9cbeee0dc0efc17414 /libcxx/test/std/utilities/memory
parent4eac9f05452b4404c36ff7c842fbf13351f73339 (diff)
downloadbcm5719-llvm-52f2683695cf26bdf18f2b3d84292a11cbbe938a.tar.gz
bcm5719-llvm-52f2683695cf26bdf18f2b3d84292a11cbbe938a.zip
Fix test failure to to new/delete ellisions
llvm-svn: 307510
Diffstat (limited to 'libcxx/test/std/utilities/memory')
-rw-r--r--libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
index 253515e3db3..f2cf9f2d418 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
@@ -29,11 +29,12 @@ struct A
int main()
{
+ globalMemCounter.reset();
std::allocator<A> a;
assert(globalMemCounter.checkOutstandingNewEq(0));
assert(A_constructed == 0);
globalMemCounter.last_new_size = 0;
- A* ap = a.allocate(3);
+ A* volatile ap = a.allocate(3);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
assert(A_constructed == 0);
@@ -42,7 +43,7 @@ int main()
assert(A_constructed == 0);
globalMemCounter.last_new_size = 0;
- A* ap2 = a.allocate(3, (const void*)5);
+ A* volatile ap2 = a.allocate(3, (const void*)5);
assert(globalMemCounter.checkOutstandingNewEq(1));
assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int)));
assert(A_constructed == 0);
OpenPOWER on IntegriCloud