2016-02-05 02:39:09 +08:00
|
|
|
// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
|
2015-02-11 10:53:03 +08:00
|
|
|
// RUN: FileCheck -input-file %t %s
|
|
|
|
// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s
|
2015-01-22 10:17:23 +08:00
|
|
|
|
|
|
|
// Since foo is never emitted, there should not be a profile name for it.
|
|
|
|
|
2016-02-06 07:36:08 +08:00
|
|
|
// CHECK-DAG: @__profn_bar = {{.*}} [3 x i8] c"bar"
|
|
|
|
// CHECK-DAG: @__profn_baz = {{.*}} [3 x i8] c"baz"
|
|
|
|
// CHECK-DAG: @__profn_unused_names.c_qux = {{.*}} [18 x i8] c"unused_names.c:qux"
|
2016-02-17 08:58:13 +08:00
|
|
|
// CHECK-DAG: @__llvm_prf_nm = private constant {{.*}}, section "{{.*}}__llvm_prf_names"
|
2015-02-11 10:53:03 +08:00
|
|
|
|
2015-12-15 08:33:12 +08:00
|
|
|
// SYSHEADER-NOT: @__profn_foo =
|
2015-02-11 10:53:03 +08:00
|
|
|
|
2015-01-22 10:17:23 +08:00
|
|
|
|
|
|
|
#ifdef IS_SYSHEADER
|
|
|
|
|
|
|
|
#pragma clang system_header
|
|
|
|
inline int foo() { return 0; }
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define IS_SYSHEADER
|
|
|
|
#include __FILE__
|
|
|
|
|
|
|
|
int bar() { return 0; }
|
2015-02-11 10:53:03 +08:00
|
|
|
inline int baz() { return 0; }
|
|
|
|
static int qux() { return 42; }
|
2015-01-22 10:17:23 +08:00
|
|
|
|
|
|
|
#endif
|