1 // Check that the profiling names we create have the linkage we expect
2 // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage.c %s -o - -emit-llvm -fprofile-instr-generate | FileCheck %s
3
4 // CHECK: @__llvm_profile_name_foo = private constant [3 x i8] c"foo"
5 // CHECK: @__llvm_profile_name_foo_weak = weak hidden constant [8 x i8] c"foo_weak"
6 // CHECK: @__llvm_profile_name_main = private constant [4 x i8] c"main"
7 // CHECK: @"__llvm_profile_name_c-linkage.c:foo_internal" = private constant [24 x i8] c"c-linkage.c:foo_internal"
8
foo(void)9 void foo(void) { }
10
11 void foo_weak(void) __attribute__((weak));
foo_weak(void)12 void foo_weak(void) { if (0){} if (0){} if (0){} if (0){} }
13
14 static void foo_internal(void);
main(void)15 int main(void) {
16 foo();
17 foo_internal();
18 foo_weak();
19 return 0;
20 }
21
foo_internal(void)22 static void foo_internal(void) { if (0){} if (0){} }
23