]> git.proxmox.com Git - rustc.git/blob - src/llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / 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 -check-prefix=CHECK -check-prefix=WHOLE-FILE %s
2 // RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %S/Inputs/lineExecutionCounts.profdata -no-colors -filename-equivalence -name=main %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
3
4 // before any coverage // WHOLE-FILE: | [[@LINE]]|// before
5 // FILTER-NOT: | [[@LINE-1]]|// before
6 int main() { // CHECK: 1| [[@LINE]]|int main(
7 int x = 0; // CHECK: 1| [[@LINE]]| int x
8 // CHECK: 1| [[@LINE]]|
9 if (x) { // CHECK: 0| [[@LINE]]| if (x)
10 x = 0; // CHECK: 0| [[@LINE]]| x = 0
11 } else { // CHECK: 1| [[@LINE]]| } else
12 x = 1; // CHECK: 1| [[@LINE]]| x = 1
13 } // CHECK: 1| [[@LINE]]| }
14 // CHECK: 1| [[@LINE]]|
15 for (int i = 0; i < 100; ++i) { // CHECK: 100| [[@LINE]]| for (
16 x = 1; // CHECK: 100| [[@LINE]]| x = 1
17 } // CHECK: 100| [[@LINE]]| }
18 // CHECK: 1| [[@LINE]]|
19 x = x < 10 ? x + 1 : x - 1; // CHECK: 0| [[@LINE]]| x =
20 x = x > 10 ? // CHECK: 1| [[@LINE]]| x =
21 x - 1: // CHECK: 0| [[@LINE]]| x
22 x + 1; // CHECK: 1| [[@LINE]]| x
23 // CHECK: 1| [[@LINE]]|
24 return 0; // CHECK: 1| [[@LINE]]| return
25 } // CHECK: 1| [[@LINE]]|}
26 // after coverage // WHOLE-FILE: | [[@LINE]]|// after
27 // FILTER-NOT: | [[@LINE-1]]|// after
28
29 // llvm-cov doesn't work on big endian yet
30 // XFAIL: powerpc64-, s390x, mips-, mips64-, sparc