2019-04-16 13:54:01 +02:00
|
|
|
// Test that `-Zpgo-gen` creates expected instrumentation artifacts in LLVM IR.
|
2019-05-22 10:35:14 +02:00
|
|
|
// Compiling with `-Cpanic=abort` because PGO+unwinding isn't supported on all platforms.
|
2019-04-16 13:54:01 +02:00
|
|
|
|
|
|
|
// needs-profiler-support
|
2019-05-22 10:35:14 +02:00
|
|
|
// compile-flags: -Z pgo-gen -Ccodegen-units=1 -Cpanic=abort
|
2019-04-16 13:54:01 +02:00
|
|
|
|
|
|
|
// CHECK: @__llvm_profile_raw_version =
|
|
|
|
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
|
|
|
|
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
|
2019-05-22 10:35:14 +02:00
|
|
|
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = private global
|
|
|
|
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = private global
|
2019-04-16 13:54:01 +02:00
|
|
|
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
|
|
|
|
|
2019-05-22 10:35:14 +02:00
|
|
|
#![crate_type="lib"]
|
|
|
|
|
2019-04-16 13:54:01 +02:00
|
|
|
#[inline(never)]
|
|
|
|
fn some_function() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-05-22 10:35:14 +02:00
|
|
|
pub fn some_other_function() {
|
2019-04-16 13:54:01 +02:00
|
|
|
some_function();
|
|
|
|
}
|