-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #126709 - Oneirical:exitestial-crisis, r=jieyouxu
Migrate `include_bytes_deps`, `optimization-remarks-dir-pgo`, `optimization-remarks-dir`, `issue-40535` and `rmeta-preferred` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Needs BSD tryjob. try-job: aarch64-apple try-job: x86_64-msvc try-job: armhf-gnu try-job: test-various
- Loading branch information
Showing
19 changed files
with
159 additions
and
70 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,13 @@ | ||
// include_bytes! and include_str! in `main.rs` | ||
// should register the included file as of #24423, | ||
// and this test checks that this is still the case. | ||
// See https://github.com/rust-lang/rust/pull/24423 | ||
|
||
use run_make_support::{invalid_utf8_contains, rustc}; | ||
|
||
fn main() { | ||
rustc().emit("dep-info").input("main.rs").run(); | ||
invalid_utf8_contains("main.d", "input.txt"); | ||
invalid_utf8_contains("main.d", "input.bin"); | ||
invalid_utf8_contains("main.d", "input.md"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,14 @@ | ||
// In a dependency hierarchy, metadata-only crates could cause an Internal | ||
// Compiler Error (ICE) due to a compiler bug - not correctly fetching sources for | ||
// metadata-only crates. This test is a minimal reproduction of a program that triggered | ||
// this bug, and checks that no ICE occurs. | ||
// See https://github.com/rust-lang/rust/issues/40535 | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("baz.rs").emit("metadata").run(); | ||
rustc().input("bar.rs").emit("metadata").extern_("baz", "libbaz.rmeta").run(); | ||
// There should be no internal compiler error. | ||
rustc().input("foo.rs").emit("metadata").extern_("bar", "libbaz.rmeta").run(); | ||
} |
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,41 @@ | ||
// This test checks the -Zremark-dir flag, which writes LLVM | ||
// optimization remarks to the YAML format. When using PGO (Profile | ||
// Guided Optimization), the Hotness attribute should be included in | ||
// the output remark files. | ||
// See https://github.com/rust-lang/rust/pull/114439 | ||
|
||
//@ needs-profiler-support | ||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{ | ||
has_extension, has_prefix, invalid_utf8_contains, llvm_profdata, run, rustc, shallow_find_files, | ||
}; | ||
|
||
fn main() { | ||
rustc().profile_generate("profdata").opt().input("foo.rs").output("foo").run(); | ||
run("foo"); | ||
// The profdata filename is a long sequence of numbers, fetch it by prefix and extension | ||
// to keep the test working even if the filename changes. | ||
let profdata_files = shallow_find_files("profdata", |path| { | ||
has_prefix(path, "default") && has_extension(path, "profraw") | ||
}); | ||
let profdata_file = profdata_files.get(0).unwrap(); | ||
llvm_profdata().merge().output("merged.profdata").input(profdata_file).run(); | ||
rustc() | ||
.profile_use("merged.profdata") | ||
.opt() | ||
.input("foo.rs") | ||
.arg("-Cremark=all") | ||
.arg("-Zremark-dir=profiles") | ||
.run(); | ||
// Check that PGO hotness is included in the remark files | ||
let remark_files = shallow_find_files("profiles", |path| { | ||
has_prefix(path, "foo") && has_extension(path, "yaml") | ||
}); | ||
assert!(!remark_files.is_empty()); | ||
for file in remark_files { | ||
if !file.to_str().unwrap().contains("codegen") { | ||
invalid_utf8_contains(file, "Hotness") | ||
}; | ||
} | ||
} |
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,39 @@ | ||
// In this test, the function `bar` has #[inline(never)] and the function `foo` | ||
// does not. This test outputs LLVM optimization remarks twice - first for all | ||
// functions (including `bar`, and the `inline` mention), and then for only `foo` | ||
// (should not have the `inline` mention). | ||
// See https://github.com/rust-lang/rust/pull/113040 | ||
|
||
use run_make_support::{ | ||
has_extension, has_prefix, invalid_utf8_contains, invalid_utf8_not_contains, not_contains, | ||
rustc, shallow_find_files, | ||
}; | ||
|
||
fn main() { | ||
rustc() | ||
.opt() | ||
.input("foo.rs") | ||
.crate_type("lib") | ||
.arg("-Cremark=all") | ||
.arg("-Zremark-dir=profiles_all") | ||
.run(); | ||
let all_remark_files = shallow_find_files("profiles_all", |path| { | ||
has_prefix(path, "foo") && has_extension(path, "yaml") && not_contains(path, "codegen") | ||
}); | ||
for file in all_remark_files { | ||
invalid_utf8_contains(file, "inline") | ||
} | ||
rustc() | ||
.opt() | ||
.input("foo.rs") | ||
.crate_type("lib") | ||
.arg("-Cremark=foo") | ||
.arg("-Zremark-dir=profiles_foo") | ||
.run(); | ||
let foo_remark_files = shallow_find_files("profiles_foo", |path| { | ||
has_prefix(path, "foo") && has_extension(path, "yaml") | ||
}); | ||
for file in foo_remark_files { | ||
invalid_utf8_not_contains(file, "inline") | ||
} | ||
} |
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,18 @@ | ||
// This test compiles `lib.rs`'s dependency, `rmeta_aux.rs`, as both an rlib | ||
// and an rmeta crate. By default, rustc should give the metadata crate (rmeta) | ||
// precedence over the rust-lib (rlib). This test inspects the contents of the binary | ||
// and that the correct (rmeta) crate was used. | ||
// rlibs being preferred could indicate a resurgence of the -Zbinary-dep-depinfo bug | ||
// seen in #68298. | ||
// See https://github.com/rust-lang/rust/pull/37681 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{invalid_utf8_contains, invalid_utf8_not_contains, rustc}; | ||
|
||
fn main() { | ||
rustc().input("rmeta_aux.rs").crate_type("rlib").emit("link,metadata").run(); | ||
rustc().input("lib.rs").crate_type("rlib").emit("dep-info").arg("-Zbinary-dep-depinfo").run(); | ||
invalid_utf8_contains("lib.d", "librmeta_aux.rmeta"); | ||
invalid_utf8_not_contains("lib.d", "librmeta_aux.rlib"); | ||
} |