Xinliang David Li | 3106d9a | 2016-01-28 18:25:53 +0000 | [diff] [blame] | 1 | // Make sure instrumentation data from available_externally functions doesn't |
| 2 | // get thrown out and are emitted with the expected linkage. |
Rong Xu | 9837ef5 | 2016-02-04 18:39:09 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 -O2 -triple x86_64-apple-macosx10.9 -main-file-name c-linkage-available_externally.c %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck %s |
Duncan P. N. Exon Smith | 7c41451 | 2014-03-20 22:50:08 +0000 | [diff] [blame] | 4 | |
Xinliang David Li | ddbdb1e | 2015-12-15 00:33:12 +0000 | [diff] [blame] | 5 | // CHECK: @__profc_foo = linkonce_odr hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8 |
Vedant Kumar | f1ccf72 | 2016-10-11 21:56:05 +0000 | [diff] [blame] | 6 | // CHECK: @__profd_foo = linkonce_odr hidden global {{.*}} i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_foo, i32 0, i32 0){{.*}}, section "__DATA,__llvm_prf_data,regular,live_support", align 8 |
Duncan P. N. Exon Smith | 7c41451 | 2014-03-20 22:50:08 +0000 | [diff] [blame] | 7 | inline int foo(void) { return 1; } |
| 8 | |
| 9 | int main(void) { |
| 10 | return foo(); |
| 11 | } |