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