Skip to content

Commit 7c23872

Browse files
committed
rewrite track-pgo-dep-info to rmake
1 parent 48a9d4b commit 7c23872

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
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/proc-macro-three-crates/rmake.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// This was fixed in #37846, and this test checks
66
// that this bug does not make a resurgence.
77

8-
//FIXME(Oneirical): ignore-cross-compile
9-
108
use run_make_support::{bare_rustc, cwd, rust_lib_name, rustc};
119

1210
fn main() {

tests/run-make/track-path-dep-info/rmake.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
// output successfully added the file as a dependency.
55
// See https://github.com/rust-lang/rust/pull/84029
66

7-
//FIXME(Oneirical): Try it on musl
8-
9-
use run_make_support::{bare_rustc, fs_wrapper, rustc};
7+
use run_make_support::{fs_wrapper, rustc};
108

119
fn main() {
12-
bare_rustc().input("macro_def.rs").run();
10+
rustc().input("macro_def.rs").run();
1311
rustc().env("EXISTING_PROC_MACRO_ENV", "1").emit("dep-info").input("macro_use.rs").run();
1412
assert!(fs_wrapper::read_to_string("macro_use.d").contains("emojis.txt:"));
1513
}

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

-25
This file was deleted.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
//@ ignore-cross-compile
8+
// Reason: the binary is executed
9+
//@ needs-profiler-support
10+
11+
use run_make_support::{fs_wrapper, llvm_profdata, run, rustc};
12+
13+
fn main() {
14+
// Generate the profile-guided-optimization (PGO) profiles
15+
rustc().profile_generate("profiles").input("main.rs").run();
16+
// Merge the profiles
17+
run("main");
18+
llvm_profdata().merge().output("merged.profdata").input("profiles").run();
19+
// Use the profiles in compilation
20+
rustc().profile_use("merged.profdata").emit("dep-info").input("main.rs").run();
21+
// Check that the profile file is in the dep-info emit file
22+
assert!(fs_wrapper::read_to_string("main.d").contains("merged.profdata"));
23+
}

0 commit comments

Comments
 (0)