forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#128363 - Oneirical:not-to-be-undertestimated,…
… r=<try> Migrate `pdb-buildinfo-cl-cmd` and `pgo-indirect-call-promotion` `run-make` tests to rmake Part of rust-lang#121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc
- Loading branch information
Showing
7 changed files
with
69 additions
and
42 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,35 @@ | ||
// Check if the pdb file contains the following information in the LF_BUILDINFO: | ||
// 1. full path to the compiler (cl) | ||
// 2. the commandline args to compile it (cmd) | ||
// This is because these used to be missing in #96475. | ||
// See https://github.com/rust-lang/rust/pull/113492 | ||
|
||
//@ only-windows-msvc | ||
// Reason: pdb files are unique to this architecture | ||
|
||
use run_make_support::{assert_contains, env_var, rfs, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.input("main.rs") | ||
.arg("-g") | ||
.crate_name("my_crate_name") | ||
.crate_type("bin") | ||
.metadata("dc9ef878b0a48666") | ||
.run(); | ||
assert_contains(rfs::read_to_string("my_crate_name.pdb"), env_var("RUSTC_ORIGINAL")); | ||
let strings = [ | ||
r#""main.rs""#, | ||
r#""-g""#, | ||
r#""--crate-name""#, | ||
r#""my_crate_name""#, | ||
r#""--crate-type""#, | ||
r#""bin""#, | ||
r#""-C""#, | ||
r#""metadata=dc9ef878b0a48666""#, | ||
r#""--out-dir""#, | ||
]; | ||
for string in strings { | ||
assert_contains(rfs::read_to_string("my_crate_name.pdb"), string); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,33 @@ | ||
// This test checks that indirect call promotion is performed. The test | ||
// programs calls the same function a thousand times through a function pointer. | ||
// Only PGO data provides the information that it actually always is the same | ||
// function. We verify that the indirect call promotion pass inserts a check | ||
// whether it can make a direct call instead of the indirect call. | ||
// See https://github.com/rust-lang/rust/pull/66631 | ||
|
||
//@ needs-profiler-support | ||
// Reason: llvm_profdata is used | ||
//@ ignore-cross-compile | ||
// Reason: the compiled binary is executed | ||
|
||
use run_make_support::{llvm_filecheck, llvm_profdata, rfs, run, rustc}; | ||
|
||
fn main() { | ||
// We don't compile `opaque` with either optimizations or instrumentation. | ||
rustc().input("opaque.rs").run(); | ||
// Compile the test program with instrumentation | ||
rfs::create_dir("prof_data_dir"); | ||
rustc().input("interesting.rs").profile_generate("prof_data_dir").opt().codegen_units(1).run(); | ||
rustc().input("main.rs").profile_generate("prof_data_dir").opt().run(); | ||
// The argument below generates to the expected branch weights | ||
run("main"); | ||
llvm_profdata().merge().output("prof_data_dir/merged.profdata").input("prof_data_dir").run(); | ||
rustc() | ||
.input("interesting.rs") | ||
.profile_use("prof_data_dir/merged.profdata") | ||
.opt() | ||
.codegen_units(1) | ||
.emit("llvm-ir") | ||
.run(); | ||
llvm_filecheck().patterns("filecheck-patterns.txt").stdin(rfs::read("interesting.ll")).run(); | ||
} |