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#126709 - Oneirical:exitestial-crisis, r=<try>
Migrate `include_bytes_deps`, `optimization-remarks-dir-pgo`, `optimization-remarks-dir`, `issue-40535` and `rmeta-preferred` `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). Needs BSD tryjob. try-job: dist-x86_64-freebsd
- Loading branch information
Showing
18 changed files
with
107 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
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,15 @@ | ||
// 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 | ||
|
||
//FIXME(Oneirical): check if works without ignore freebsd | ||
|
||
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,19 @@ | ||
// 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 message. | ||
rustc() | ||
.input("foo.rs") | ||
.emit("metadata") | ||
.extern_("bar", "libbaz.rmeta") | ||
.run() | ||
.assert_stderr_not_contains("unexpectedly panicked"); | ||
} |
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,29 @@ | ||
// 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::{invalid_utf8_contains, llvm_profdata, run, rustc}; | ||
|
||
fn main() { | ||
rustc().profile_generate("profdata").opt().input("foo.rs").output("foo").run(); | ||
run("foo"); | ||
llvm_profdata() | ||
.merge() | ||
.output("merged.profdata") | ||
.input("profdata/default_15907418011457399462_0.profraw") | ||
.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 | ||
invalid_utf8_contains("profiles/foo.cba44757bc0621b9-cgu.0.opt.opt.yaml", "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,26 @@ | ||
// 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::{invalid_utf8_contains, invalid_utf8_not_contains, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.opt() | ||
.input("foo.rs") | ||
.crate_type("lib") | ||
.arg("-Cremark=all") | ||
.arg("-Zremark-dir=profiles_all") | ||
.run(); | ||
invalid_utf8_contains("profiles_all/foo.5be5606e1f6aa79b-cgu.0.opt.opt.yaml", "inline"); | ||
rustc() | ||
.opt() | ||
.input("foo.rs") | ||
.crate_type("lib") | ||
.arg("-Cremark=foo") | ||
.arg("-Zremark-dir=profiles_foo") | ||
.run(); | ||
invalid_utf8_not_contains("profiles_foo/foo.5be5606e1f6aa79b-cgu.0.opt.opt.yaml", "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"); | ||
} |