xref: /minix3/external/bsd/llvm/dist/clang/test/CoverageMapping/macroparams.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams.c %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc #define MACRO2(X2) (X2 + 2) // CHECK-DAG: File 2, [[@LINE]]:20 -> [[@LINE]]:28 = #0 (HasCodeBefore = 0)
4*0a6a1f1dSLionel Sambuc #define MACRO(X) MACRO2(x)  // CHECK-DAG: File 1, [[@LINE]]:25 -> [[@LINE]]:26 = #0 (HasCodeBefore = 0)
5*0a6a1f1dSLionel Sambuc                             // CHECK-DAG: Expansion,File 1, [[@LINE-1]]:18 -> [[@LINE-1]]:24 = #0 (HasCodeBefore = 0, Expanded file = 2)
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc 
main()8*0a6a1f1dSLionel Sambuc int main() {                // CHECK-DAG: File 0, [[@LINE]]:12 -> [[@LINE+4]]:2 = #0 (HasCodeBefore = 0)
9*0a6a1f1dSLionel Sambuc   int x = 0;
10*0a6a1f1dSLionel Sambuc   MACRO(x);                 // CHECK-DAG: Expansion,File 0, [[@LINE]]:3 -> [[@LINE]]:8 = #0 (HasCodeBefore = 0, Expanded file = 1)
11*0a6a1f1dSLionel Sambuc   return 0;
12*0a6a1f1dSLionel Sambuc }
13