macroparams2.c 576 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name macroparams2.c %s | FileCheck %s
  2. #define MACRO(REFS, CALLS) (4 * (CALLS) < (REFS))
  3. struct S {
  4. int i, j;
  5. };
  6. // CHECK: File 0, [[@LINE+1]]:12 -> [[@LINE+10]]:2 = #0
  7. int main() {
  8. struct S arr[32] = { 0 };
  9. int n = 0;
  10. // CHECK-NEXT: Expansion,File 0, [[@LINE+2]]:7 -> [[@LINE+2]]:12 = #0
  11. // CHECK-NEXT: File 0, [[@LINE+1]]:34 -> [[@LINE+3]]:4 = #1
  12. if (MACRO(arr[n].j, arr[n].i)) {
  13. n = 1;
  14. }
  15. return n;
  16. }
  17. // CHECK: File 1, 3:29 -> 3:51 = #0