1*9caa3fbeSZequan Wu // RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -std=c++11 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name system_macro.cpp -o - %s | FileCheck %s
2efd319a2SVedant Kumar 
3efd319a2SVedant Kumar #ifdef IS_SYSHEADER
4efd319a2SVedant Kumar 
5efd319a2SVedant Kumar #pragma clang system_header
6efd319a2SVedant Kumar #define Func(x) if (x) {}
7efd319a2SVedant Kumar #define SomeType int
8efd319a2SVedant Kumar 
9efd319a2SVedant Kumar #else
10efd319a2SVedant Kumar 
11efd319a2SVedant Kumar #define IS_SYSHEADER
12efd319a2SVedant Kumar #include __FILE__
13efd319a2SVedant Kumar 
14efd319a2SVedant Kumar // CHECK-LABEL: doSomething
doSomething(int x)15efd319a2SVedant Kumar void doSomething(int x) { // CHECK: File 0, [[@LINE]]:25 -> {{[0-9:]+}} = #0
16efd319a2SVedant Kumar   Func(x);
17efd319a2SVedant Kumar   return;
18efd319a2SVedant Kumar   SomeType *f; // CHECK: File 0, [[@LINE]]:11 -> {{[0-9:]+}} = 0
19efd319a2SVedant Kumar }
20efd319a2SVedant Kumar 
21efd319a2SVedant Kumar // CHECK-LABEL: main
main()22efd319a2SVedant Kumar int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+2]]:2 = #0
23efd319a2SVedant Kumar   Func([] { return true; }());
24efd319a2SVedant Kumar }
25efd319a2SVedant Kumar 
26efd319a2SVedant Kumar #endif
27