-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
24 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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 | ||
|
||
//FIXME(Oneirical): try it on musl | ||
//@ 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")); | ||
} |