[PGO] Shorten profile symbol prefixes
[oota-llvm.git] / test / Instrumentation / InstrProfiling / PR23499.ll
1 ;; Check that data associated with linkonce odr functions are placed in
2 ;; the same comdat section as their associated function.
3
4 ; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -instrprof -S | FileCheck %s
5 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -S | FileCheck %s
6
7 $_Z3barIvEvv = comdat any
8
9 @__prf_nm__Z3barIvEvv = linkonce_odr hidden constant [11 x i8] c"_Z3barIvEvv", align 1
10
11 ; CHECK: @__prf_nm__Z3barIvEvv = linkonce_odr hidden constant [11 x i8] c"_Z3barIvEvv", section "{{.*}}__llvm_prf_names", comdat($__llvm_profile_vars__Z3barIvEvv), align 1
12 ; CHECK: @__prf_cn__Z3barIvEvv = linkonce_odr hidden global [1 x i64] zeroinitializer, section "{{.*}}__llvm_prf_cnts", comdat($__llvm_profile_vars__Z3barIvEvv), align 8
13 ; CHECK: @__prf_dt__Z3barIvEvv = linkonce_odr hidden global { i32, i32, i64, i8*, i64*, i8*, i8*, [1 x i16] } { i32 11, i32 1, i64 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__prf_nm__Z3barIvEvv, i32 0, i32 0), i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__prf_cn__Z3barIvEvv, i32 0, i32 0), i8* null, i8* null, [1 x i16] zeroinitializer }, section "{{.*}}__llvm_prf_data", comdat($__llvm_profile_vars__Z3barIvEvv), align 8
14
15 declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #1
16
17 define linkonce_odr void @_Z3barIvEvv() comdat {
18 entry:
19   call void @llvm.instrprof.increment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__prf_nm__Z3barIvEvv, i32 0, i32 0), i64 0, i32 1, i32 0)
20   ret void
21 }