summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-02-23 22:20:32 +0000
committerVedant Kumar <vsk@apple.com>2017-02-23 22:20:32 +0000
commit11813280712d3e9468b48931a4a62ed8cfa038cf (patch)
tree4221d2b41460ee48d74510013cb39a41bb4ec1ef /llvm/test/tools
parentcc75d2441d664002174d9cca824502e352d8a3a8 (diff)
downloadbcm5719-llvm-11813280712d3e9468b48931a4a62ed8cfa038cf.tar.gz
bcm5719-llvm-11813280712d3e9468b48931a4a62ed8cfa038cf.zip
[llvm-cov] Strip redundant path components from filenames (fix PR31982)
Instead of stripping the longest common prefix off of the filenames in a report, strip out the longest chain of redundant path components. This fixes the case in PR31982, where there are two files with the same prefix, and stripping out the LCP makes things less intelligible. llvm-svn: 296029
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/llvm-cov/Inputs/multiple-files2.covmappingbin0 -> 136 bytes
-rw-r--r--llvm/test/tools/llvm-cov/multiple-files.test20
2 files changed, 13 insertions, 7 deletions
diff --git a/llvm/test/tools/llvm-cov/Inputs/multiple-files2.covmapping b/llvm/test/tools/llvm-cov/Inputs/multiple-files2.covmapping
new file mode 100644
index 00000000000..770817a5380
--- /dev/null
+++ b/llvm/test/tools/llvm-cov/Inputs/multiple-files2.covmapping
Binary files differ
diff --git a/llvm/test/tools/llvm-cov/multiple-files.test b/llvm/test/tools/llvm-cov/multiple-files.test
index 0b3fb855fed..d0dbdd8c0fc 100644
--- a/llvm/test/tools/llvm-cov/multiple-files.test
+++ b/llvm/test/tools/llvm-cov/multiple-files.test
@@ -1,9 +1,15 @@
// RUN: llvm-profdata merge %S/Inputs/multiple-files.proftext -o %t.profdata
-// RUN: llvm-cov report %S/Inputs/multiple-files.covmapping -instr-profile %t.profdata | FileCheck %s
+// RUN: llvm-cov report %S/Inputs/multiple-files.covmapping -instr-profile %t.profdata | FileCheck %s -check-prefix=MANY_COMPONENTS
+// RUN: llvm-cov report %S/Inputs/multiple-files2.covmapping -instr-profile %t.profdata | FileCheck %s -check-prefix=ONE_COMPONENT
-// CHECK: Filename
-// CHECK-NEXT: ---
-// CHECK-NEXT: {{^}}a{{[/\\]}}f2.c
-// CHECK-NEXT: {{^}}b{{[/\\]}}c{{[/\\]}}f4.c
-// CHECK-NEXT: {{^}}b{{[/\\]}}f3.c
-// CHECK-NEXT: {{^}}f1.c
+// MANY_COMPONENTS: Filename
+// MANY_COMPONENTS-NEXT: ---
+// MANY_COMPONENTS-NEXT: {{^}}a{{[/\\]}}f2.c
+// MANY_COMPONENTS-NEXT: {{^}}b{{[/\\]}}c{{[/\\]}}f4.c
+// MANY_COMPONENTS-NEXT: {{^}}b{{[/\\]}}f3.c
+// MANY_COMPONENTS-NEXT: {{^}}f1.c
+
+// ONE_COMPONENT: Filename
+// ONE_COMPONENT-NEXT: ---
+// ONE_COMPONENT-NEXT: {{^}}cov.c
+// ONE_COMPONENT-NEXT: {{^}}cov.h
OpenPOWER on IntegriCloud