Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CoverageMapping] Remove dots from paths inside the profile
We already remove dots from collected paths and path mappings. This makes it difficult to match paths inside the profile which contain dots. For example, we would never match /path/to/../file.c because the collected path is always be normalized to /path/file.c. This change enables dot removal for paths inside the profile to address the issue. Differential Revision: https://reviews.llvm.org/D122750
- Loading branch information
Showing
8 changed files
with
37 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
int f() { return 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "header.h" | ||
|
||
int main() { | ||
return f(); | ||
} |
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
llvm/test/tools/llvm-cov/Inputs/relative_dir/main.proftext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
f | ||
# Func Hash: | ||
24 | ||
# Num Counters: | ||
1 | ||
# Counter Values: | ||
1 | ||
|
||
main | ||
# Func Hash: | ||
24 | ||
# Num Counters: | ||
1 | ||
# Counter Values: | ||
1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# RUN: llvm-profdata merge %S/Inputs/relative_dir/main.proftext \ | ||
# RUN: -o %t.profdata | ||
# RUN: llvm-cov report %S/Inputs/relative_dir/main.covmapping \ | ||
# RUN: -instr-profile %t.profdata \ | ||
# RUN: -compilation-dir=%S/Inputs/relative_dir/out/default \ | ||
# RUN: %S/Inputs/relative_dir/header.h \ | ||
# RUN: | FileCheck -DDIR=%S/Inputs/relative_dir --check-prefix=REPORT %s | ||
|
||
# REPORT: {{^}}[[DIR]]{{/|\\}}header.h{{.*}} | ||
# REPORT: {{^}}TOTAL{{.*}}100.00% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters