mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
llvm-cov: add code coverage tool that's based on coverage mapping format and clang's pgo.
This commit expands llvm-cov's functionality by adding support for a new code coverage tool that uses LLVM's coverage mapping format and clang's instrumentation based profiling. The gcov compatible tool can be invoked by supplying the 'gcov' command as the first argument, or by modifying the tool's name to end with 'gcov'. Differential Revision: http://reviews.llvm.org/D4445 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
22
test/tools/llvm-cov/showLineExecutionCounts.cpp
Normal file
22
test/tools/llvm-cov/showLineExecutionCounts.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence %s | FileCheck %s
|
||||
|
||||
int main() { // CHECK: 1| [[@LINE]]|int main(
|
||||
int x = 0; // CHECK: 1| [[@LINE]]| int x
|
||||
// CHECK: 1| [[@LINE]]|
|
||||
if (x) { // CHECK: 0| [[@LINE]]| if (x)
|
||||
x = 0; // CHECK: 0| [[@LINE]]| x = 0
|
||||
} else { // CHECK: 1| [[@LINE]]| } else
|
||||
x = 1; // CHECK: 1| [[@LINE]]| x = 1
|
||||
} // CHECK: 1| [[@LINE]]| }
|
||||
// CHECK: 1| [[@LINE]]|
|
||||
for (int i = 0; i < 100; ++i) { // CHECK: 100| [[@LINE]]| for (
|
||||
x = 1; // CHECK: 100| [[@LINE]]| x = 1
|
||||
} // CHECK: 100| [[@LINE]]| }
|
||||
// CHECK: 1| [[@LINE]]|
|
||||
x = x < 10 ? x + 1 : x - 1; // CHECK: 0| [[@LINE]]| x =
|
||||
x = x > 10 ? // CHECK: 1| [[@LINE]]| x =
|
||||
x - 1: // CHECK: 0| [[@LINE]]| x
|
||||
x + 1; // CHECK: 1| [[@LINE]]| x
|
||||
// CHECK: 1| [[@LINE]]|
|
||||
return 0; // CHECK: 1| [[@LINE]]| return
|
||||
} // CHECK: 1| [[@LINE]]|}
|
||||
Reference in New Issue
Block a user