summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ProfileData/CoverageMappingTest.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-09-29 22:13:58 +0000
committerJustin Bogner <mail@justinbogner.com>2015-09-29 22:13:58 +0000
commit9e9a057a9b4fd7d738d988038019fac087b01626 (patch)
tree1d1a1c9828ed255dab9c6dfe52c8bb74936d0e93 /llvm/unittests/ProfileData/CoverageMappingTest.cpp
parentcce239c45d6ef3865a017b5b3f935964e0348734 (diff)
downloadbcm5719-llvm-9e9a057a9b4fd7d738d988038019fac087b01626.tar.gz
bcm5719-llvm-9e9a057a9b4fd7d738d988038019fac087b01626.zip
InstrProf: Support for value profiling in the indexed profile format
Add support to the indexed instrprof reader and writer for the format that will be used for value profiling. Patch by Betul Buyukkurt, with minor modifications. llvm-svn: 248833
Diffstat (limited to 'llvm/unittests/ProfileData/CoverageMappingTest.cpp')
-rw-r--r--llvm/unittests/ProfileData/CoverageMappingTest.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
index a0995fbbc02..35b8626c494 100644
--- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp
+++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
@@ -188,7 +188,8 @@ TEST_F(CoverageMappingTest, expansion_gets_first_counter) {
}
TEST_F(CoverageMappingTest, basic_coverage_iteration) {
- ProfileWriter.addFunctionCounts("func", 0x1234, {30, 20, 10, 0});
+ InstrProfRecord Record("func", 0x1234, {30, 20, 10, 0});
+ ProfileWriter.addRecord(std::move(Record));
readProfCounts();
addCMR(Counter::getCounter(0), "file1", 1, 1, 9, 9);
@@ -238,7 +239,8 @@ TEST_F(CoverageMappingTest, uncovered_function_with_mapping) {
}
TEST_F(CoverageMappingTest, combine_regions) {
- ProfileWriter.addFunctionCounts("func", 0x1234, {10, 20, 30});
+ InstrProfRecord Record("func", 0x1234, {10, 20, 30});
+ ProfileWriter.addRecord(std::move(Record));
readProfCounts();
addCMR(Counter::getCounter(0), "file1", 1, 1, 9, 9);
@@ -256,7 +258,8 @@ TEST_F(CoverageMappingTest, combine_regions) {
}
TEST_F(CoverageMappingTest, dont_combine_expansions) {
- ProfileWriter.addFunctionCounts("func", 0x1234, {10, 20});
+ InstrProfRecord Record("func", 0x1234, {10, 20});
+ ProfileWriter.addRecord(std::move(Record));
readProfCounts();
addCMR(Counter::getCounter(0), "file1", 1, 1, 9, 9);
@@ -275,7 +278,8 @@ TEST_F(CoverageMappingTest, dont_combine_expansions) {
}
TEST_F(CoverageMappingTest, strip_filename_prefix) {
- ProfileWriter.addFunctionCounts("file1:func", 0x1234, {10});
+ InstrProfRecord Record("file1:func", 0x1234, {10});
+ ProfileWriter.addRecord(std::move(Record));
readProfCounts();
addCMR(Counter::getCounter(0), "file1", 1, 1, 9, 9);
OpenPOWER on IntegriCloud