• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Check that we combine expansion regions.
2 
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 -filename-equivalence %s | FileCheck %s
5 
6 #define SIMPLE_OP \
7   ++x
8 // CHECK:       | [[@LINE-2]]|#define SIMPLE_OP
9 // CHECK-NEXT: 2| [[@LINE-2]]|  ++x
10 
11 #define DO_SOMETHING \
12   {                  \
13     int x = 0;       \
14     SIMPLE_OP;       \
15   }
16 // CHECK:       | [[@LINE-5]]|#define DO_SOMETHING
17 // CHECK-NEXT: 2| [[@LINE-5]]|  {
18 // CHECK-NEXT: 2| [[@LINE-5]]|    int x = 0;
19 // CHECK-NEXT: 2| [[@LINE-5]]|    SIMPLE_OP;
20 // CHECK-NEXT: 2| [[@LINE-5]]|  }
21 
main()22 int main() {    // CHECK:      1| [[@LINE]]|int main() {
23   DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]|  DO_SOMETHING;
24   DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]|  DO_SOMETHING;
25   return 0;     // CHECK-NEXT: 1| [[@LINE]]|  return 0;
26 }               // CHECK-NEXT: 1| [[@LINE]]|}
27