[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / llvm / test / tools / llvm-cov / combine_expansions.cpp
blobb870d61f232326e877e22d3a4ead0b815d1542fe
1 // Check that we combine expansion regions.
3 // RUN: llvm-profdata merge %S/Inputs/combine_expansions.proftext -o %t.profdata
4 // RUN: llvm-cov show %S/Inputs/combine_expansions.covmapping -instr-profile %t.profdata -path-equivalence=/tmp/ec,%S %s | FileCheck %s
6 #define SIMPLE_OP \
7 ++x
8 // CHECK: [[@LINE-2]]| |#define SIMPLE_OP
9 // CHECK-NEXT: [[@LINE-2]]| 2| ++x
11 #define DO_SOMETHING \
12 { \
13 int x = 0; \
14 SIMPLE_OP; \
16 // CHECK: [[@LINE-5]]| |#define DO_SOMETHING
17 // CHECK-NEXT: [[@LINE-5]]| 2| {
18 // CHECK-NEXT: [[@LINE-5]]| 2| int x = 0;
19 // CHECK-NEXT: [[@LINE-5]]| 2| SIMPLE_OP;
20 // CHECK-NEXT: [[@LINE-5]]| 2| }
22 int main() { // CHECK: [[@LINE]]| 1|int main() {
23 DO_SOMETHING; // CHECK-NEXT: [[@LINE]]| 1| DO_SOMETHING;
24 DO_SOMETHING; // CHECK-NEXT: [[@LINE]]| 1| DO_SOMETHING;
25 return 0; // CHECK-NEXT: [[@LINE]]| 1| return 0;
26 } // CHECK-NEXT: [[@LINE]]| 1|}