2019-05-28 14:48:03 +00:00
|
|
|
// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
|
2019-04-16 11:54:01 +00:00
|
|
|
|
|
|
|
// needs-profiler-support
|
2021-07-19 15:14:58 +00:00
|
|
|
// compile-flags: -Cprofile-generate -Ccodegen-units=1
|
2019-04-16 11:54:01 +00:00
|
|
|
|
|
|
|
// CHECK: @__llvm_profile_raw_version =
|
2019-07-15 11:59:55 +00:00
|
|
|
// CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
|
|
|
|
// CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
|
|
|
|
// CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
|
|
|
|
// CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
|
2019-04-16 11:54:01 +00:00
|
|
|
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
|
|
|
|
|
2019-05-22 08:35:14 +00:00
|
|
|
#![crate_type="lib"]
|
|
|
|
|
2019-04-16 11:54:01 +00:00
|
|
|
#[inline(never)]
|
|
|
|
fn some_function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-05-22 08:35:14 +00:00
|
|
|
pub fn some_other_function() {
|
2019-04-16 11:54:01 +00:00
|
|
|
some_function();
|
|
|
|
}
|