blob: 8a57957378d1fb7fceb8700a351ed01029d123dc [file] [log] [blame]
Justin Bogner2368c822015-02-11 02:53:03 +00001// 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
Justin Bogner00270df2015-01-22 02:17:23 +00004
5// Since foo is never emitted, there should not be a profile name for it.
6
Justin Bogner2368c822015-02-11 02:53:03 +00007// 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
Justin Bogner00270df2015-01-22 02:17:23 +000013
14#ifdef IS_SYSHEADER
15
16#pragma clang system_header
17inline int foo() { return 0; }
18
19#else
20
21#define IS_SYSHEADER
22#include __FILE__
23
24int bar() { return 0; }
Justin Bogner2368c822015-02-11 02:53:03 +000025inline int baz() { return 0; }
26static int qux() { return 42; }
Justin Bogner00270df2015-01-22 02:17:23 +000027
28#endif