mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-04 00:29:28 +00:00

Summary: This patch adds the -path-equivalence option (example: llvm-cov show -path-equivalence=/origin/path,/local/path) which maps the source code path from one machine to another when using `llvm-cov show`. This is similar to the -filename-equivalence option, but doesn't require you to specify all the source files on the command line. This allows you to generate the coverage data on one machine (e.g. in a CI system), and then use llvm-cov on another machine where you have the same code base on a different path. Reviewers: vsk Reviewed By: vsk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36391 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310827 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
1018 B
C++
28 lines
1018 B
C++
// RUN: llvm-cov show %S/Inputs/showExpansions.covmapping -instr-profile %S/Inputs/showExpansions.profdata -dump -show-expansions -path-equivalence="/Users/bogner/code/llvm/test/tools,%S/.." %s 2>&1 | FileCheck %s
|
|
|
|
#define DO_SOMETHING_ELSE() \
|
|
do { \
|
|
} while (0)
|
|
#define ANOTHER_THING() \
|
|
do { \
|
|
if (0) { \
|
|
} \
|
|
} while (0)
|
|
|
|
#define DO_SOMETHING(x) \
|
|
do { \
|
|
if (x) \
|
|
DO_SOMETHING_ELSE(); \
|
|
else \
|
|
ANOTHER_THING(); \
|
|
} while (0)
|
|
// CHECK-DAG: Expansion at line [[@LINE-4]], 7 -> 24
|
|
// CHECK-DAG: Expansion at line [[@LINE-3]], 7 -> 20
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
for (int i = 0; i < 100; ++i)
|
|
DO_SOMETHING(i); // CHECK-DAG: Expansion at line [[@LINE]], 5 -> 17
|
|
return 0;
|
|
}
|
|
// RUN: llvm-cov export %S/Inputs/showExpansions.covmapping -instr-profile %S/Inputs/showExpansions.profdata 2>&1 | FileCheck %S/Inputs/showExpansions.json
|