Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4aee83b

Browse files
committedJul 5, 2024
rewrite track-pgo-dep-info to rmake
1 parent 48a9d4b commit 4aee83b

File tree

3 files changed

+22
-26
lines changed

3 files changed

+22
-26
lines changed
 

‎src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ run-make/target-without-atomic-cas/Makefile
158158
run-make/test-benches/Makefile
159159
run-make/thumb-none-cortex-m/Makefile
160160
run-make/thumb-none-qemu/Makefile
161-
run-make/track-pgo-dep-info/Makefile
162161
run-make/translation/Makefile
163162
run-make/type-mismatch-same-crate-name/Makefile
164163
run-make/unstable-flag-required/Makefile

‎tests/run-make/track-pgo-dep-info/Makefile

-25
This file was deleted.
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Emitting dep-info files used to not have any mention of PGO profiles used
2+
// in compilation, which meant these profiles could be changed without consequence.
3+
// After changing this in #100801, this test checks that the profile data is successfully
4+
// included in dep-info emit files.
5+
// See https://github.com/rust-lang/rust/pull/100801
6+
7+
//FIXME(Oneirical): try it on musl
8+
//@ needs-profiler-support
9+
10+
use run_make_support::{fs_wrapper, llvm_profdata, run, rustc};
11+
12+
fn main() {
13+
// Generate the profile-guided-optimization (PGO) profiles
14+
rustc().profile_generate("profiles").input("main.rs").run();
15+
// Merge the profiles
16+
run("main");
17+
llvm_profdata().merge().output("merged.profdata").input("profiles").run();
18+
// Use the profiles in compilation
19+
rustc().profile_use("merged.profdata").emit("dep-info").input("main.rs").run();
20+
// Check that the profile file is in the dep-info emit file
21+
assert!(fs_wrapper::read_to_string("main.d").contains("merged.profdata"));
22+
}

0 commit comments

Comments
 (0)
Failed to load comments.