]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Profile/c-linkage.c
Vendor import of clang trunk r238337:
[FreeBSD/FreeBSD.git] / test / Profile / c-linkage.c
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
9 void foo(void) { }
10
11 void foo_weak(void) __attribute__((weak));
12 void foo_weak(void) { if (0){} if (0){} if (0){} if (0){} }
13
14 static void foo_internal(void);
15 int main(void) {
16   foo();
17   foo_internal();
18   foo_weak();
19   return 0;
20 }
21
22 static void foo_internal(void) { if (0){} if (0){} }