forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#126607 - Oneirical:the-testern-world, r=jieyouxu
Rewrite `separate-link`, `separate-link-fail` and `allocator-shim-circular-deps` `run-make` tests to `ui` or `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).
- Loading branch information
Showing
8 changed files
with
46 additions
and
29 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,16 @@ | ||
// This test is designed to intentionally introduce a circular dependency scenario to check | ||
// that a specific compiler bug doesn't make a resurgence. | ||
// The bug in question arose when at least one crate | ||
// required a global allocator, and that crate was placed after | ||
// the one defining it in the linker order. | ||
// The generated symbols.o should not result in any linker errors. | ||
// See https://github.com/rust-lang/rust/issues/112715 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("my_lib.rs").run(); | ||
rustc().input("main.rs").arg("--test").extern_("my_lib", rust_lib_name("my_lib")).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 @@ | ||
fn main() {} |
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 @@ | ||
// rustc usually wants Rust code as its input. The flag `link-only` is one | ||
// exception, where a .rlink file is instead requested. The compiler should | ||
// fail when the user is wrongly passing the original Rust code | ||
// instead of the generated .rlink file when this flag is on. | ||
// https://github.com/rust-lang/rust/issues/95297 | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc() | ||
.arg("-Zlink-only") | ||
.input("foo.rs") | ||
.run_fail() | ||
.assert_stderr_contains("The input does not look like a .rlink file"); | ||
} |
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,14 @@ | ||
// The compiler flags no-link (and by extension, link-only) used to be broken | ||
// due to changes in encoding/decoding. This was patched, and this test checks | ||
// that these flags are not broken again, resulting in successful compilation. | ||
// See https://github.com/rust-lang/rust/issues/77857 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().stdin(b"fn main(){}").arg("-Zno-link").arg("-").run(); | ||
rustc().arg("-Zlink-only").input("rust_out.rlink").run(); | ||
run("rust_out"); | ||
} |