• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// FULL: SF:{{.*}}showLineExecutionCounts.cpp
2// FULL: FN:6,main
3// FULL: FNDA:161,main
4// FULL: FNF:1
5// FULL: FNH:1
6int main() {                              // FULL: DA:[[@LINE]],161
7  int x = 0;                              // FULL: DA:[[@LINE]],161
8                                          // FULL: DA:[[@LINE]],161
9  if (x) {                                // FULL: DA:[[@LINE]],161
10    x = 0;                                // FULL: DA:[[@LINE]],0
11  } else {                                // FULL: DA:[[@LINE]],161
12    x = 1;                                // FULL: DA:[[@LINE]],161
13  }                                       // FULL: DA:[[@LINE]],161
14                                          // FULL: DA:[[@LINE]],161
15  for (int i = 0; i < 100; ++i) {         // FULL: DA:[[@LINE]],16261
16    x = 1;                                // FULL: DA:[[@LINE]],16100
17  }                                       // FULL: DA:[[@LINE]],16100
18                                          // FULL: DA:[[@LINE]],161
19  x = x < 10 ? x + 1 : x - 1;             // FULL: DA:[[@LINE]],161
20  x = x > 10 ?                            // FULL: DA:[[@LINE]],161
21        x - 1:                            // FULL: DA:[[@LINE]],0
22        x + 1;                            // FULL: DA:[[@LINE]],161
23                                          // FULL: DA:[[@LINE]],161
24  return 0;                               // FULL: DA:[[@LINE]],161
25}                                         // FULL: DA:[[@LINE]],161
26// FULL: LF:20
27// FULL: LH:18
28// FULL: end_of_record
29// RUN: llvm-profdata merge %S/Inputs/lineExecutionCounts.proftext -o %t.profdata
30// RUN: llvm-cov export -format=lcov %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata %s | FileCheck -check-prefixes=FULL %s
31
32// RUN: llvm-cov export -format=lcov -summary-only %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata %s | FileCheck -check-prefixes=SUMMARYONLY %s
33// SUMMARYONLY: SF:{{.*}}showLineExecutionCounts.cpp
34// SUMMARYONLY: FNF:1
35// SUMMARYONLY: FNH:1
36// SUMMARYONLY: LF:20
37// SUMMARYONLY: LH:18
38// SUMMARYONLY: end_of_record
39