blob: 649fa09b245f3809cca577975ec42302aca44242 [file] [log] [blame]
Rong Xu9837ef52016-02-04 18:39:09 +00001// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t
Justin Bogner2368c822015-02-11 02:53:03 +00002// RUN: FileCheck -input-file %t %s
3// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s
Justin Bogner00270df2015-01-22 02:17:23 +00004
Vedant Kumar95030042017-02-14 20:03:56 +00005// CHECK-DAG: @__profc_bar
Reid Kleckner5bbdfeac2019-02-10 20:17:07 +00006// CHECK-DAG: @__llvm_prf_nm = private constant {{.*}}, section "{{.*__llvm_prf_names|\.lprfn\$M}}"
Justin Bogner2368c822015-02-11 02:53:03 +00007
Vedant Kumar95030042017-02-14 20:03:56 +00008// These are never instantiated, so we shouldn't get counters for them.
9//
10// CHECK-NOT: @__profc_baz
11// CHECK-NOT: @__profc_unused_names.c_qux
12
13// SYSHEADER-NOT: @__profc_foo =
Justin Bogner2368c822015-02-11 02:53:03 +000014
Justin Bogner00270df2015-01-22 02:17:23 +000015
16#ifdef IS_SYSHEADER
17
18#pragma clang system_header
19inline int foo() { return 0; }
20
21#else
22
23#define IS_SYSHEADER
24#include __FILE__
25
26int bar() { return 0; }
Justin Bogner2368c822015-02-11 02:53:03 +000027inline int baz() { return 0; }
28static int qux() { return 42; }
Justin Bogner00270df2015-01-22 02:17:23 +000029
30#endif