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: @__profn_bar = {{.*}} [3 x i8] c"bar", section "{{.*}}__llvm_prf_names"
      8 // CHECK-DAG: @__profn_baz = {{.*}} [3 x i8] c"baz", section "{{.*}}__llvm_prf_names"
      9 // CHECK-DAG: @__profn_unused_names.c_qux = {{.*}} [18 x i8] c"unused_names.c:qux", section "{{.*}}__llvm_prf_names"
     10 
     11 // SYSHEADER-NOT: @__profn_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