[llvm-branch-commits] [compiler-rt] f23fae2 - [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 10 17:01:13 PST 2020


Author: Fangrui Song
Date: 2020-12-10T16:57:10-08:00
New Revision: f23fae29eb38b9e9d0c6195fa82a882167bd8abe

URL: https://github.com/llvm/llvm-project/commit/f23fae29eb38b9e9d0c6195fa82a882167bd8abe
DIFF: https://github.com/llvm/llvm-project/commit/f23fae29eb38b9e9d0c6195fa82a882167bd8abe.diff

LOG: [test] Fix compiler-rt/test/profile/coverage_emptylines.cpp if the build directory is under /tmp

llvm-cov -path-equivalence=/tmp,... is used by some checked-in coverage mapping
files where the original filename is under /tmp. If the test itself produces the
coverage mapping file, there is no need for /tmp.

For coverage_emptylines.cpp: the source filename is under the build directory.
If the build directory is under /tmp, the path mapping will make
llvm-cov fail to find the file.

Added: 
    

Modified: 
    compiler-rt/test/profile/Linux/coverage_ctors.cpp
    compiler-rt/test/profile/Linux/coverage_dtor.cpp
    compiler-rt/test/profile/Linux/coverage_test.cpp
    compiler-rt/test/profile/coverage_comments.cpp
    compiler-rt/test/profile/coverage_emptylines.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/profile/Linux/coverage_ctors.cpp b/compiler-rt/test/profile/Linux/coverage_ctors.cpp
index adf078e56305..5c38ecb5d0e3 100644
--- a/compiler-rt/test/profile/Linux/coverage_ctors.cpp
+++ b/compiler-rt/test/profile/Linux/coverage_ctors.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_profgen -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s
 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t -instr-profile %t.profdata 2>&1 | FileCheck %s
 
 struct Base {
   int B;

diff  --git a/compiler-rt/test/profile/Linux/coverage_dtor.cpp b/compiler-rt/test/profile/Linux/coverage_dtor.cpp
index c91dd42d21d3..499ef01458ae 100644
--- a/compiler-rt/test/profile/Linux/coverage_dtor.cpp
+++ b/compiler-rt/test/profile/Linux/coverage_dtor.cpp
@@ -1,7 +1,7 @@
 // RUN: %clang_profgen -x c++ -fno-exceptions  -std=c++11 -fuse-ld=gold -fcoverage-mapping -o %t %s
 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t -instr-profile %t.profdata 2>&1 | FileCheck %s
 
 int g = 100;
 struct Base {

diff  --git a/compiler-rt/test/profile/Linux/coverage_test.cpp b/compiler-rt/test/profile/Linux/coverage_test.cpp
index 67adeb724349..e6370a996c0e 100644
--- a/compiler-rt/test/profile/Linux/coverage_test.cpp
+++ b/compiler-rt/test/profile/Linux/coverage_test.cpp
@@ -1,12 +1,12 @@
 // RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fcoverage-mapping -Wl,--gc-sections -o %t %s
 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t -instr-profile %t.profdata 2>&1 | FileCheck %s
 // BFD linker older than 2.26 has a bug that per-func profile data will be wrongly garbage collected when GC is turned on. We only do end-to-end test here without GC:
 // RUN: %clang_profgen -O2  -fcoverage-mapping  -o %t.2 %s
 // RUN: env LLVM_PROFILE_FILE=%t.2.profraw %run %t.2
 // RUN: llvm-profdata merge -o %t.2.profdata %t.2.profraw
-// RUN: llvm-cov show %t.2 -instr-profile %t.2.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t.2 -instr-profile %t.2.profdata 2>&1 | FileCheck %s
 // Check covmap is not garbage collected when GC is turned on with BFD linker. Due to the bug mentioned above, we can only
 // do the check with objdump:
 // RUN: %clang_profgen -O2  -fcoverage-mapping -Wl,--gc-sections -o %t.3 %s
@@ -15,7 +15,7 @@
 // RUN: %clang_profgen -fuse-ld=gold -O2 -fdata-sections -ffunction-sections -fPIE -pie -fcoverage-mapping -Wl,--gc-sections -o %t.pie %s
 // RUN: env LLVM_PROFILE_FILE=%t.pie.profraw %run %t.pie
 // RUN: llvm-profdata merge -o %t.pie.profdata %t.pie.profraw
-// RUN: llvm-cov show %t.pie -instr-profile %t.pie.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t.pie -instr-profile %t.pie.profdata 2>&1 | FileCheck %s
 
 void foo(bool cond) { // CHECK:  [[@LINE]]| 1|void foo(
   if (cond) {         // CHECK:  [[@LINE]]| 1| if (cond) {

diff  --git a/compiler-rt/test/profile/coverage_comments.cpp b/compiler-rt/test/profile/coverage_comments.cpp
index 0cf78add7913..d206fb608792 100644
--- a/compiler-rt/test/profile/coverage_comments.cpp
+++ b/compiler-rt/test/profile/coverage_comments.cpp
@@ -1,7 +1,7 @@
 // RUN: %clangxx_profgen -fcoverage-mapping -Wno-comment -o %t %s
 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t -instr-profile %t.profdata 2>&1 | FileCheck %s
 
 int main() {                           // CHECK:       [[# @LINE]]| 1|int main() {
     /* comment */ int x = 0;           // CHECK-NEXT:  [[# @LINE]]| 1|

diff  --git a/compiler-rt/test/profile/coverage_emptylines.cpp b/compiler-rt/test/profile/coverage_emptylines.cpp
index ba3c1a180484..8610d70f3e1b 100644
--- a/compiler-rt/test/profile/coverage_emptylines.cpp
+++ b/compiler-rt/test/profile/coverage_emptylines.cpp
@@ -3,7 +3,7 @@
 // RUN: %clangxx_profgen -fcoverage-mapping -o %t %t.stripped.cpp
 // RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
 // RUN: llvm-profdata merge -o %t.profdata %t.profraw
-// RUN: llvm-cov show %t -instr-profile %t.profdata -path-equivalence=/tmp,%S 2>&1 | FileCheck %s
+// RUN: llvm-cov show %t -instr-profile %t.profdata 2>&1 | FileCheck %s
 
 
 int main() {                        // CHECK:       [[# @LINE]]| 1|int main() {


        


More information about the llvm-branch-commits mailing list