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.
Rollup merge of rust-lang#126964 - Oneirical:total-catestrophe, r=Kobzol Migrate `lto-empty`, `invalid-so` and `issue-20626` `run-make` tests to rmake.rs 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).
- Loading branch information
Showing
8 changed files
with
50 additions
and
32 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 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,17 @@ | ||
// When a fake library was given to the compiler, it would | ||
// result in an obscure and unhelpful error message. This test | ||
// creates a false "foo" dylib, and checks that the standard error | ||
// explains that the file exists, but that its metadata is incorrect. | ||
// See https://github.com/rust-lang/rust/pull/88368 | ||
|
||
use run_make_support::{dynamic_lib_name, fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
fs_wrapper::create_file(dynamic_lib_name("foo")); | ||
rustc() | ||
.crate_type("lib") | ||
.extern_("foo", dynamic_lib_name("foo")) | ||
.input("bar.rs") | ||
.run_fail() | ||
.assert_stderr_contains("invalid metadata files for crate `foo`"); | ||
} |
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,17 @@ | ||
// Compiling Rust code twice in a row with "fat" link-time-optimizations used to cause | ||
// an internal compiler error (ICE). This was due to how the compiler would cache some modules | ||
// to make subsequent compilations faster, at least one of which was required for LTO to link | ||
// into. After this was patched in #63956, this test checks that the bug does not make | ||
// a resurgence. | ||
// See https://github.com/rust-lang/rust/issues/63349 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("lib.rs").arg("-Clto=fat").opt_level("3").incremental("inc-fat").run(); | ||
rustc().input("lib.rs").arg("-Clto=fat").opt_level("3").incremental("inc-fat").run(); | ||
rustc().input("lib.rs").arg("-Clto=thin").opt_level("3").incremental("inc-thin").run(); | ||
rustc().input("lib.rs").arg("-Clto=thin").opt_level("3").incremental("inc-thin").run(); | ||
} |
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
tests/run-make/raw-fn-pointer-opt-undefined-behavior/rmake.rs
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,16 @@ | ||
// Despite the absence of any unsafe Rust code, foo.rs in this test would, | ||
// because of the raw function pointer, | ||
// cause undefined behavior and fail to print the expected result, "4" - | ||
// only when activating optimizations (opt-level 2). This test checks | ||
// that this bug does not make a resurgence. | ||
// Note that the bug cannot be observed in an assert_eq!, only in the stdout. | ||
// See https://github.com/rust-lang/rust/issues/20626 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").opt().run(); | ||
run("foo").assert_stdout_equals("4"); | ||
} |