llvm/clang/test/CoverageMapping/unused_names.c

// RUN: %clang_cc1 -mllvm -emptyline-comment-coverage=false -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
// RUN: FileCheck -input-file %t %s
// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s

// CHECK-DAG: @__profc_bar
// CHECK-DAG: @__llvm_prf_nm = private constant {{.*}}, section "{{.*__llvm_prf_names|\.lprfn\$M}}"

// These are never instantiated, so we shouldn't get counters for them.
//
// CHECK-NOT: @__profc_baz
// CHECK-NOT: @__profc_unused_names.c_qux

// SYSHEADER-NOT: @__profc_foo =


#ifdef IS_SYSHEADER

#pragma clang system_header
inline int foo(void) { return 0; }

#else

#define IS_SYSHEADER
#include __FILE__

int bar(void) { return 0; }
inline int baz(void) { return 0; }
static int qux(void) { return 42; }

#endif