mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
InstrProf: Strip filename prefixes from the names we display for coverage
For consumers of coverage data, any filename prefixes we store in the profile data are just noise. Strip this prefix if it exists. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236558 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -259,4 +259,18 @@ TEST_F(CoverageMappingTest, dont_combine_expansions) {
|
||||
ASSERT_EQ(CoverageSegment(9, 9, false), Segments[3]);
|
||||
}
|
||||
|
||||
TEST_F(CoverageMappingTest, strip_filename_prefix) {
|
||||
ProfileWriter.addFunctionCounts("file1:func", 0x1234, {10});
|
||||
readProfCounts();
|
||||
|
||||
addCMR(Counter::getCounter(0), "file1", 1, 1, 9, 9);
|
||||
loadCoverageMapping("file1:func", 0x1234);
|
||||
|
||||
std::vector<std::string> Names;
|
||||
for (const auto &Func : LoadedCoverage->getCoveredFunctions())
|
||||
Names.push_back(Func.Name);
|
||||
ASSERT_EQ(1U, Names.size());
|
||||
ASSERT_EQ("func", Names[0]);
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Reference in New Issue
Block a user