From 263722f40f46c98c2a24c6b1f102c3875803502b Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Tue, 7 Feb 2017 23:13:10 +0000 Subject: [asan] replace std::random_shuffle with std::shuffle in tests since std::random_shuffle is being deprecated in C++17; NFC llvm-svn: 294370 --- compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc') diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc index 8df5efda674..e14517fca51 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include using namespace __sanitizer; @@ -539,6 +540,7 @@ void TestCombinedAllocator() { Allocator; Allocator *a = new Allocator; a->Init(/* may_return_null */ true, kReleaseToOSIntervalNever); + std::mt19937 r; AllocatorCache cache; memset(&cache, 0, sizeof(cache)); @@ -570,7 +572,7 @@ void TestCombinedAllocator() { allocated.push_back(x); } - random_shuffle(allocated.begin(), allocated.end()); + std::shuffle(allocated.begin(), allocated.end(), r); for (uptr i = 0; i < kNumAllocs; i++) { void *x = allocated[i]; -- cgit v1.2.3