2014-12-09 02:02:35 +08:00
|
|
|
;; Checks for platform specific section names and initialization code.
|
|
|
|
|
|
|
|
; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -instrprof -S | FileCheck %s -check-prefix=MACHO
|
2016-05-11 07:37:19 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-apple-macosx10.10.0 -passes=instrprof -S | FileCheck %s -check-prefix=MACHO
|
2015-10-14 02:39:48 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-unknown-linux -instrprof -S | FileCheck %s -check-prefix=LINUX
|
2016-04-19 01:47:38 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-unknown-linux -passes=instrprof -S | FileCheck %s -check-prefix=LINUX
|
2015-10-19 12:17:10 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-unknown-freebsd -instrprof -S | FileCheck %s -check-prefix=FREEBSD
|
2016-05-11 07:37:19 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-unknown-freebsd -passes=instrprof -S | FileCheck %s -check-prefix=FREEBSD
|
2016-02-27 14:01:26 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-scei-ps4 -instrprof -S | FileCheck %s -check-prefix=PS4
|
2016-05-11 07:37:19 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-scei-ps4 -passes=instrprof -S | FileCheck %s -check-prefix=PS4
|
2015-10-19 12:17:10 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-pc-solaris -instrprof -S | FileCheck %s -check-prefix=SOLARIS
|
2016-05-11 07:37:19 +08:00
|
|
|
; RUN: opt < %s -mtriple=x86_64-pc-solaris -passes=instrprof -S | FileCheck %s -check-prefix=SOLARIS
|
2014-12-09 02:02:35 +08:00
|
|
|
|
2015-12-15 08:32:56 +08:00
|
|
|
@__profn_foo = hidden constant [3 x i8] c"foo"
|
2017-02-15 03:08:39 +08:00
|
|
|
; MACHO: @__profn_foo = private constant [3 x i8] c"foo"
|
|
|
|
; ELF: @__profn_foo = private constant [3 x i8] c"foo"
|
2014-12-09 02:02:35 +08:00
|
|
|
|
2015-12-15 08:32:56 +08:00
|
|
|
; MACHO: @__profc_foo = hidden global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
|
|
|
|
; ELF: @__profc_foo = hidden global [1 x i64] zeroinitializer, section "__llvm_prf_cnts", align 8
|
2014-12-09 02:02:35 +08:00
|
|
|
|
2016-10-12 05:48:16 +08:00
|
|
|
; MACHO: @__profd_foo = hidden {{.*}}, section "__DATA,__llvm_prf_data,regular,live_support", align 8
|
2015-12-15 08:32:56 +08:00
|
|
|
; LINUX: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
|
|
|
|
; FREEBSD: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
|
2016-02-27 14:01:26 +08:00
|
|
|
; PS4: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
|
2015-12-15 08:32:56 +08:00
|
|
|
; SOLARIS: @__profd_foo = hidden {{.*}}, section "__llvm_prf_data", align 8
|
2015-11-19 02:14:55 +08:00
|
|
|
|
2016-02-09 02:13:49 +08:00
|
|
|
; ELF: @__llvm_prf_nm = private constant [{{.*}} x i8] c"{{.*}}", section "{{.*}}__llvm_prf_names"
|
|
|
|
|
2014-12-09 02:02:35 +08:00
|
|
|
define void @foo() {
|
2015-12-15 08:32:56 +08:00
|
|
|
call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 0, i32 1, i32 0)
|
2014-12-09 02:02:35 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.instrprof.increment(i8*, i64, i32, i32)
|
|
|
|
|
|
|
|
;; Emit registration functions for platforms that don't find the
|
|
|
|
;; symbols by their sections.
|
|
|
|
|
|
|
|
; MACHO-NOT: define internal void @__llvm_profile_register_functions
|
2015-10-14 02:39:48 +08:00
|
|
|
; LINUX-NOT: define internal void @__llvm_profile_register_functions
|
2015-10-19 12:17:10 +08:00
|
|
|
; FREEBSD-NOT: define internal void @__llvm_profile_register_functions
|
2016-02-27 14:01:26 +08:00
|
|
|
; PS4-NOT: define internal void @__llvm_profile_register_functions
|
2015-10-19 12:17:10 +08:00
|
|
|
; SOLARIS: define internal void @__llvm_profile_register_functions
|
2014-12-09 02:02:35 +08:00
|
|
|
|
|
|
|
; MACHO-NOT: define internal void @__llvm_profile_init
|
2015-10-14 15:24:14 +08:00
|
|
|
; LINUX-NOT: define internal void @__llvm_profile_init
|
2015-10-19 12:17:10 +08:00
|
|
|
; FREEBSD-NOT: define internal void @__llvm_profile_init
|
2016-02-27 14:01:26 +08:00
|
|
|
; PS4-NOT: define internal void @__llvm_profile_init
|
2015-10-19 12:17:10 +08:00
|
|
|
; SOLARIS: define internal void @__llvm_profile_init
|