]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/pgo-instrumentation.rs
Suggest defining type parameter when appropriate
[rust.git] / src / test / codegen / pgo-instrumentation.rs
1 // Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
2 // Compiling with `-Cpanic=abort` because PGO+unwinding isn't supported on all platforms.
3
4 // needs-profiler-support
5 // compile-flags: -Cprofile-generate -Ccodegen-units=1 -Cpanic=abort
6
7 // CHECK: @__llvm_profile_raw_version =
8 // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
9 // CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
10 // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
11 // CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
12 // CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
13
14 #![crate_type="lib"]
15
16 #[inline(never)]
17 fn some_function() {
18
19 }
20
21 pub fn some_other_function() {
22     some_function();
23 }