This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3275b18f8979: [Coverage] Normalize compilation dir as well 
(authored by phosek).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97001/new/

https://reviews.llvm.org/D97001

Files:
  clang/lib/CodeGen/CoverageMappingGen.cpp
  clang/test/Profile/profile-prefix-map.c


Index: clang/test/Profile/profile-prefix-map.c
===================================================================
--- clang/test/Profile/profile-prefix-map.c
+++ clang/test/Profile/profile-prefix-map.c
@@ -16,3 +16,6 @@
 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm 
-mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c 
%t/root/nested/profile-prefix-map.c -fprofile-prefix-map=%/t/root=. -o - | 
FileCheck --check-prefix=PROFILE-PREFIX-MAP %s
 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm 
-mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c 
../root/nested/profile-prefix-map.c -fprofile-prefix-map=../root=. -o - | 
FileCheck --check-prefix=PROFILE-PREFIX-MAP %s
 // PROFILE-PREFIX-MAP: @__llvm_coverage_mapping = 
{{.*"\\02.*}}.{{/|\\+}}nested{{.*profile-prefix-map\.c}}
+
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm 
-mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c 
%t/root/nested/profile-prefix-map.c -fprofile-compilation-dir=/custom 
-fprofile-prefix-map=/custom=/nonsense -o - | FileCheck 
--check-prefix=PROFILE-COMPILATION-DIR %s
+// PROFILE-COMPILATION-DIR: @__llvm_coverage_mapping = {{.*"\\02.*}}nonsense
Index: clang/lib/CodeGen/CoverageMappingGen.cpp
===================================================================
--- clang/lib/CodeGen/CoverageMappingGen.cpp
+++ clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1726,7 +1726,7 @@
   llvm::SmallVector<std::string, 16> FilenameStrs;
   FilenameStrs.resize(FileEntries.size() + 1);
   // The first filename is the current working directory.
-  FilenameStrs[0] = getCurrentDirname();
+  FilenameStrs[0] = normalizeFilename(getCurrentDirname());
   for (const auto &Entry : FileEntries) {
     auto I = Entry.second;
     FilenameStrs[I] = normalizeFilename(Entry.first->getName());


Index: clang/test/Profile/profile-prefix-map.c
===================================================================
--- clang/test/Profile/profile-prefix-map.c
+++ clang/test/Profile/profile-prefix-map.c
@@ -16,3 +16,6 @@
 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c %t/root/nested/profile-prefix-map.c -fprofile-prefix-map=%/t/root=. -o - | FileCheck --check-prefix=PROFILE-PREFIX-MAP %s
 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c ../root/nested/profile-prefix-map.c -fprofile-prefix-map=../root=. -o - | FileCheck --check-prefix=PROFILE-PREFIX-MAP %s
 // PROFILE-PREFIX-MAP: @__llvm_coverage_mapping = {{.*"\\02.*}}.{{/|\\+}}nested{{.*profile-prefix-map\.c}}
+
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -mllvm -enable-name-compression=false -main-file-name profile-prefix-map.c %t/root/nested/profile-prefix-map.c -fprofile-compilation-dir=/custom -fprofile-prefix-map=/custom=/nonsense -o - | FileCheck --check-prefix=PROFILE-COMPILATION-DIR %s
+// PROFILE-COMPILATION-DIR: @__llvm_coverage_mapping = {{.*"\\02.*}}nonsense
Index: clang/lib/CodeGen/CoverageMappingGen.cpp
===================================================================
--- clang/lib/CodeGen/CoverageMappingGen.cpp
+++ clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1726,7 +1726,7 @@
   llvm::SmallVector<std::string, 16> FilenameStrs;
   FilenameStrs.resize(FileEntries.size() + 1);
   // The first filename is the current working directory.
-  FilenameStrs[0] = getCurrentDirname();
+  FilenameStrs[0] = normalizeFilename(getCurrentDirname());
   for (const auto &Entry : FileEntries) {
     auto I = Entry.second;
     FilenameStrs[I] = normalizeFilename(Entry.first->getName());
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to