Skip to content

Commit e2acaee

Browse files
Add codegen test that makes sure PGO instrumentation is emitted as expected.
1 parent 227be65 commit e2acaee

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Test that `-Zpgo-gen` creates expected instrumentation artifacts in LLVM IR.
2+
3+
// needs-profiler-support
4+
// compile-flags: -Z pgo-gen -Ccodegen-units=1
5+
6+
// CHECK: @__llvm_profile_raw_version =
7+
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
8+
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}some_function{{.*}} = private global
9+
// CHECK: @__profc_{{.*}}pgo_instrumentation{{.*}}main{{.*}} = private global
10+
// CHECK: @__profd_{{.*}}pgo_instrumentation{{.*}}main{{.*}} = private global
11+
// CHECK: @__llvm_profile_filename = {{.*}}"default_%m.profraw\00"{{.*}}
12+
13+
#[inline(never)]
14+
fn some_function() {
15+
16+
}
17+
18+
fn main() {
19+
some_function();
20+
}

0 commit comments

Comments
 (0)