2019-05-28 16:48:03 +02:00
|
|
|
// Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
|
2019-04-16 13:54:01 +02:00
|
|
|
|
2024-03-16 17:02:30 +11:00
|
|
|
//@ compile-flags: -Zno-profiler-runtime
|
2021-07-19 17:14:58 +02:00
|
|
|
//@ compile-flags: -Cprofile-generate -Ccodegen-units=1
|
2019-04-16 13:54:01 +02:00
|
|
|
|
|
|
|
// CHECK: @__llvm_profile_raw_version =
|
2019-07-15 13:59:55 +02: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 13:54:01 +02:00
|
|
|
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
|
|
|
|
|
2024-05-29 14:11:20 +10:00
|
|
|
#![crate_type = "lib"]
|
2019-05-22 10:35:14 +02:00
|
|
|
|
2019-04-16 13:54:01 +02:00
|
|
|
#[inline(never)]
|
2024-05-29 14:11:20 +10:00
|
|
|
fn some_function() {}
|
2019-04-16 13:54:01 +02:00
|
|
|
|
2019-05-22 10:35:14 +02:00
|
|
|
pub fn some_other_function() {
|
2019-04-16 13:54:01 +02:00
|
|
|
some_function();
|
|
|
|
}
|