summaryrefslogtreecommitdiffstats
path: root/unittests/ProfileData/InstrProfTest.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
committerdim <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
commitd2fc7c7001ed3babcd0106d15dd70224abfb6f29 (patch)
tree7c411f9b5d807f7f204fdd16965d8925a82b6d18 /unittests/ProfileData/InstrProfTest.cpp
parent60174f118de85cbcad51deb11c650f22c9be2235 (diff)
downloadFreeBSD-src-d2fc7c7001ed3babcd0106d15dd70224abfb6f29.zip
FreeBSD-src-d2fc7c7001ed3babcd0106d15dd70224abfb6f29.tar.gz
Vendor import of llvm trunk r241361:
https://llvm.org/svn/llvm-project/llvm/trunk@241361
Diffstat (limited to 'unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r--unittests/ProfileData/InstrProfTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/ProfileData/InstrProfTest.cpp b/unittests/ProfileData/InstrProfTest.cpp
index 26ea0e4..2cedd59 100644
--- a/unittests/ProfileData/InstrProfTest.cpp
+++ b/unittests/ProfileData/InstrProfTest.cpp
@@ -68,6 +68,7 @@ TEST_F(InstrProfTest, write_and_read_one_function) {
TEST_F(InstrProfTest, get_function_counts) {
Writer.addFunctionCounts("foo", 0x1234, {1, 2});
+ Writer.addFunctionCounts("foo", 0x1235, {3, 4});
auto Profile = Writer.writeBuffer();
readProfile(std::move(Profile));
@@ -77,6 +78,11 @@ TEST_F(InstrProfTest, get_function_counts) {
ASSERT_EQ(1U, Counts[0]);
ASSERT_EQ(2U, Counts[1]);
+ ASSERT_TRUE(NoError(Reader->getFunctionCounts("foo", 0x1235, Counts)));
+ ASSERT_EQ(2U, Counts.size());
+ ASSERT_EQ(3U, Counts[0]);
+ ASSERT_EQ(4U, Counts[1]);
+
std::error_code EC;
EC = Reader->getFunctionCounts("foo", 0x5678, Counts);
ASSERT_TRUE(ErrorEquals(instrprof_error::hash_mismatch, EC));
OpenPOWER on IntegriCloud