Skip to content

Commit

Permalink
rewrite track-pgo-dep-info to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 8, 2024
1 parent 48a9d4b commit 7c23872
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ run-make/target-without-atomic-cas/Makefile
run-make/test-benches/Makefile
run-make/thumb-none-cortex-m/Makefile
run-make/thumb-none-qemu/Makefile
run-make/track-pgo-dep-info/Makefile
run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile
run-make/unstable-flag-required/Makefile
Expand Down
2 changes: 0 additions & 2 deletions tests/run-make/proc-macro-three-crates/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// This was fixed in #37846, and this test checks
// that this bug does not make a resurgence.

//FIXME(Oneirical): ignore-cross-compile

use run_make_support::{bare_rustc, cwd, rust_lib_name, rustc};

fn main() {
Expand Down
6 changes: 2 additions & 4 deletions tests/run-make/track-path-dep-info/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
// output successfully added the file as a dependency.
// See https://github.com/rust-lang/rust/pull/84029

//FIXME(Oneirical): Try it on musl

use run_make_support::{bare_rustc, fs_wrapper, rustc};
use run_make_support::{fs_wrapper, rustc};

fn main() {
bare_rustc().input("macro_def.rs").run();
rustc().input("macro_def.rs").run();
rustc().env("EXISTING_PROC_MACRO_ENV", "1").emit("dep-info").input("macro_use.rs").run();
assert!(fs_wrapper::read_to_string("macro_use.d").contains("emojis.txt:"));
}
25 changes: 0 additions & 25 deletions tests/run-make/track-pgo-dep-info/Makefile

This file was deleted.

23 changes: 23 additions & 0 deletions tests/run-make/track-pgo-dep-info/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Emitting dep-info files used to not have any mention of PGO profiles used
// in compilation, which meant these profiles could be changed without consequence.
// After changing this in #100801, this test checks that the profile data is successfully
// included in dep-info emit files.
// See https://github.com/rust-lang/rust/pull/100801

//@ ignore-cross-compile
// Reason: the binary is executed
//@ needs-profiler-support

use run_make_support::{fs_wrapper, llvm_profdata, run, rustc};

fn main() {
// Generate the profile-guided-optimization (PGO) profiles
rustc().profile_generate("profiles").input("main.rs").run();
// Merge the profiles
run("main");
llvm_profdata().merge().output("merged.profdata").input("profiles").run();
// Use the profiles in compilation
rustc().profile_use("merged.profdata").emit("dep-info").input("main.rs").run();
// Check that the profile file is in the dep-info emit file
assert!(fs_wrapper::read_to_string("main.d").contains("merged.profdata"));
}

0 comments on commit 7c23872

Please sign in to comment.