Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(656)

Unified Diff: unittest/IceELFSectionTest.cpp

Issue 1072913002: Subzero: Use a "deterministic" random shuffle for register allocation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests_lit/llvm2ice_tests/randomize-regalloc.ll ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittest/IceELFSectionTest.cpp
diff --git a/unittest/IceELFSectionTest.cpp b/unittest/IceELFSectionTest.cpp
index 8dbcc65137906f29a77b254172e16bbc1a037839..57e43c14b312392374c749aab9430711be4fbfd1 100644
--- a/unittest/IceELFSectionTest.cpp
+++ b/unittest/IceELFSectionTest.cpp
@@ -90,8 +90,11 @@ TEST(IceELFSectionTest, StringTableBuilderPermSeveral) {
Strings.push_back(".shstrtab");
Strings.push_back("_start");
const SizeT NumTests = 128;
+ const uint64_t RandomSeed = 12345; // arbitrary value for now
+ RandomNumberGenerator R(RandomSeed);
+ RandomNumberGeneratorWrapper RNG(R);
for (SizeT i = 0; i < NumTests; ++i) {
- std::random_shuffle(Strings.begin(), Strings.end());
+ RandomShuffle(Strings.begin(), Strings.end(), RNG);
ELFStringTableSection Strtab(".strtab", SHT_STRTAB, 0, 1, 0);
for (auto &S : Strings) {
Strtab.add(S);
« no previous file with comments | « tests_lit/llvm2ice_tests/randomize-regalloc.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698