2016-01-29 02:25:53 +08:00
|
|
|
// Check that the profiling counters and data we create have the linkage we expect
|
2016-02-05 02:39:09 +08:00
|
|
|
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s
|
2014-03-18 05:18:30 +08:00
|
|
|
|
2016-01-29 02:25:53 +08:00
|
|
|
// CHECK: @__profc_foo = private global
|
|
|
|
// CHECK: @__profd_foo = private global
|
|
|
|
// CHECK: @__profc_foo_weak = weak hidden global
|
2021-06-04 22:39:49 +08:00
|
|
|
// CHECK: @__profd_foo_weak = weak hidden global
|
2016-01-29 02:25:53 +08:00
|
|
|
// CHECK: @__profc_main = private global
|
|
|
|
// CHECK: @__profd_main = private global
|
|
|
|
// CHECK: @__profc_c_linkage.c_foo_internal = private global
|
|
|
|
// CHECK: @__profd_c_linkage.c_foo_internal = private global
|
2014-12-09 03:04:51 +08:00
|
|
|
|
2014-03-18 05:18:30 +08:00
|
|
|
void foo(void) { }
|
|
|
|
|
|
|
|
void foo_weak(void) __attribute__((weak));
|
|
|
|
void foo_weak(void) { if (0){} if (0){} if (0){} if (0){} }
|
|
|
|
|
|
|
|
static void foo_internal(void);
|
|
|
|
int main(void) {
|
|
|
|
foo();
|
|
|
|
foo_internal();
|
|
|
|
foo_weak();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void foo_internal(void) { if (0){} if (0){} }
|