diff options
author | Mandeep Singh Grang <mgrang@codeaurora.org> | 2018-04-07 01:29:45 +0000 |
---|---|---|
committer | Mandeep Singh Grang <mgrang@codeaurora.org> | 2018-04-07 01:29:45 +0000 |
commit | 13e70cb1811e8f7c0cacc16a272c95b4634490f9 (patch) | |
tree | 69c1f4c8124b9068c98b107b1cdd2f8881b9a20a /llvm/unittests/ProfileData | |
parent | b12cc2003a2375cd3e207bb831930719d11521ab (diff) | |
download | bcm5719-llvm-13e70cb1811e8f7c0cacc16a272c95b4634490f9.tar.gz bcm5719-llvm-13e70cb1811e8f7c0cacc16a272c95b4634490f9.zip |
[unittests] Change std::sort to llvm::sort in response to r327219
r327219 added wrappers to std::sort which randomly shuffle the container before
sorting. This will help in uncovering non-determinism caused due to undefined
sorting order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of
std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to
llvm::sort. Refer the comments section in D44363 for a list of all the
required patches.
llvm-svn: 329475
Diffstat (limited to 'llvm/unittests/ProfileData')
-rw-r--r-- | llvm/unittests/ProfileData/InstrProfTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index 09be2e3dad7..0c99f7fde65 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -712,7 +712,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) { }; std::unique_ptr<InstrProfValueData[]> VD_0( Record.getValueForSite(IPVK_IndirectCallTarget, 0)); - std::sort(&VD_0[0], &VD_0[5], Cmp); + llvm::sort(&VD_0[0], &VD_0[5], Cmp); ASSERT_EQ(StringRef((const char *)VD_0[0].Value, 7), StringRef("callee2")); ASSERT_EQ(1000U, VD_0[0].Count); ASSERT_EQ(StringRef((const char *)VD_0[1].Value, 7), StringRef("callee3")); @@ -726,7 +726,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) { std::unique_ptr<InstrProfValueData[]> VD_1( Record.getValueForSite(IPVK_IndirectCallTarget, 1)); - std::sort(&VD_1[0], &VD_1[4], Cmp); + llvm::sort(&VD_1[0], &VD_1[4], Cmp); ASSERT_EQ(StringRef((const char *)VD_1[0].Value, 7), StringRef("callee2")); ASSERT_EQ(2500U, VD_1[0].Count); ASSERT_EQ(StringRef((const char *)VD_1[1].Value, 7), StringRef("callee1")); @@ -738,7 +738,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) { std::unique_ptr<InstrProfValueData[]> VD_2( Record.getValueForSite(IPVK_IndirectCallTarget, 2)); - std::sort(&VD_2[0], &VD_2[3], Cmp); + llvm::sort(&VD_2[0], &VD_2[3], Cmp); ASSERT_EQ(StringRef((const char *)VD_2[0].Value, 7), StringRef("callee4")); ASSERT_EQ(5500U, VD_2[0].Count); ASSERT_EQ(StringRef((const char *)VD_2[1].Value, 7), StringRef("callee3")); @@ -748,7 +748,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write) { std::unique_ptr<InstrProfValueData[]> VD_3( Record.getValueForSite(IPVK_IndirectCallTarget, 3)); - std::sort(&VD_3[0], &VD_3[2], Cmp); + llvm::sort(&VD_3[0], &VD_3[2], Cmp); ASSERT_EQ(StringRef((const char *)VD_3[0].Value, 7), StringRef("callee3")); ASSERT_EQ(2000U, VD_3[0].Count); ASSERT_EQ(StringRef((const char *)VD_3[1].Value, 7), StringRef("callee2")); @@ -781,7 +781,7 @@ TEST_P(MaybeSparseInstrProfTest, value_prof_data_read_write_mapping) { }; std::unique_ptr<InstrProfValueData[]> VD_0( Record.getValueForSite(IPVK_IndirectCallTarget, 0)); - std::sort(&VD_0[0], &VD_0[5], Cmp); + llvm::sort(&VD_0[0], &VD_0[5], Cmp); ASSERT_EQ(VD_0[0].Value, 0x2000ULL); ASSERT_EQ(1000U, VD_0[0].Count); ASSERT_EQ(VD_0[1].Value, 0x3000ULL); |