system_macro.c 635 B

123456789101112131415161718192021222324
  1. // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name system_macro.c -o - %s | FileCheck %s
  2. #ifdef IS_SYSHEADER
  3. #pragma clang system_header
  4. #define Func(x) if (x) {}
  5. #define SomeType int
  6. #else
  7. #define IS_SYSHEADER
  8. #include __FILE__
  9. // CHECK-LABEL: doSomething:
  10. void doSomething(int x) { // CHECK: File 0, [[@LINE]]:25 -> {{[0-9:]+}} = #0
  11. Func(x); // CHECK: Expansion,File 0, [[@LINE]]:3 -> [[@LINE]]:7
  12. return;
  13. // CHECK: Expansion,File 0, [[@LINE+1]]:3 -> [[@LINE+1]]:11
  14. SomeType *f; // CHECK: File 0, [[@LINE]]:11 -> {{[0-9:]+}} = 0
  15. }
  16. int main() {}
  17. #endif