]> git.lizzy.rs Git - rust.git/blob - tests/codegen/pgo-instrumentation.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / codegen / pgo-instrumentation.rs
1 // Test that `-Cprofile-generate` creates expected instrumentation artifacts in LLVM IR.
2
3 // needs-profiler-support
4 // compile-flags: -Cprofile-generate -Ccodegen-units=1
5
6 // CHECK: @__llvm_profile_raw_version =
7 // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
8 // CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = {{.*}}global
9 // CHECK-DAG: @__profc_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
10 // CHECK-DAG: @__profd_{{.*}}pgo_instrumentation{{.*}}some_other_function{{.*}} = {{.*}}global
11 // CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
12
13 #![crate_type="lib"]
14
15 #[inline(never)]
16 fn some_function() {
17
18 }
19
20 pub fn some_other_function() {
21     some_function();
22 }