Home | History | Annotate | Download | only in CoverageMapping
      1 // RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
      2 // RUN: FileCheck -input-file %t %s
      3 // RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s
      4 
      5 // Since foo is never emitted, there should not be a profile name for it.
      6 
      7 // CHECK-DAG: @__llvm_profile_name_bar = {{.*}} section "{{.*}}__llvm_prf_names"
      8 // CHECK-DAG: @__llvm_profile_name_baz = {{.*}} section "{{.*}}__llvm_prf_names"
      9 // CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} section "{{.*}}__llvm_prf_names"
     10 
     11 // SYSHEADER-NOT: @__llvm_profile_name_foo =
     12 
     13 
     14 #ifdef IS_SYSHEADER
     15 
     16 #pragma clang system_header
     17 inline int foo() { return 0; }
     18 
     19 #else
     20 
     21 #define IS_SYSHEADER
     22 #include __FILE__
     23 
     24 int bar() { return 0; }
     25 inline int baz() { return 0; }
     26 static int qux() { return 42; }
     27 
     28 #endif
     29