llvm-cov: Fix an issue with showing regions but not counts
[oota-llvm.git] / test / tools / llvm-cov / showLineExecutionCounts.cpp
1 // RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence %s | FileCheck %s
2
3 int main() {                             // CHECK:   1| [[@LINE]]|int main(
4   int x = 0;                             // CHECK:   1| [[@LINE]]|  int x
5                                          // CHECK:   1| [[@LINE]]|
6   if (x) {                               // CHECK:   0| [[@LINE]]|  if (x)
7     x = 0;                               // CHECK:   0| [[@LINE]]|    x = 0
8   } else {                               // CHECK:   1| [[@LINE]]|  } else
9     x = 1;                               // CHECK:   1| [[@LINE]]|    x = 1
10   }                                      // CHECK:   1| [[@LINE]]|  }
11                                          // CHECK:   1| [[@LINE]]|
12   for (int i = 0; i < 100; ++i) {        // CHECK: 100| [[@LINE]]|  for (
13     x = 1;                               // CHECK: 100| [[@LINE]]|    x = 1
14   }                                      // CHECK: 100| [[@LINE]]|  }
15                                          // CHECK:   1| [[@LINE]]|
16   x = x < 10 ? x + 1 : x - 1;            // CHECK:   0| [[@LINE]]|  x =
17   x = x > 10 ?                           // CHECK:   1| [[@LINE]]|  x =
18         x - 1:                           // CHECK:   0| [[@LINE]]|        x
19         x + 1;                           // CHECK:   1| [[@LINE]]|        x
20                                          // CHECK:   1| [[@LINE]]|
21   return 0;                              // CHECK:   1| [[@LINE]]|  return
22 }                                        // CHECK:   1| [[@LINE]]|}
23
24 // llvm-cov doesn't work on big endian yet
25 // XFAIL: powerpc64-, s390x, mips-, mips64-, sparc