-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #126484 - Oneirical:test-in-peace, r=jieyouxu,kobzol
Migrate `std-core-cycle`, `obey-crate-type-flag`, `mixing-libs` and `issue-18943` `run-make` tests to `rmake.rs` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-apple-1 try-job: x86_64-msvc try-job: aarch64-gnu
- Loading branch information
Showing
10 changed files
with
83 additions
and
50 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.
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 @@ | ||
// Inside a library, implementing a trait for another trait | ||
// with a lifetime used to cause an internal compiler error (ICE). | ||
// This test checks that this bug does not make a resurgence - | ||
// first by ensuring successful compilation, then verifying that | ||
// the lib crate-type flag was actually followed. | ||
// See https://github.com/rust-lang/rust/issues/18943 | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").crate_type("lib").run(); | ||
assert!(Path::new(&rust_lib_name("foo")).exists()); | ||
} |
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,21 @@ | ||
// Having multiple upstream crates available in different formats | ||
// should result in failed compilation. This test causes multiple | ||
// libraries to exist simultaneously as rust libs and dynamic libs, | ||
// causing prog.rs to fail compilation. | ||
// See https://github.com/rust-lang/rust/issues/10434 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{dynamic_lib_name, fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
rustc().input("rlib.rs").crate_type("rlib").crate_type("dylib").run(); | ||
|
||
// Not putting `-C prefer-dynamic` here allows for static linking of librlib.rlib. | ||
rustc().input("dylib.rs").run(); | ||
|
||
// librlib's dynamic version needs to be removed here to prevent prog.rs from fetching | ||
// the wrong one. | ||
fs_wrapper::remove_file(dynamic_lib_name("rlib")); | ||
rustc().input("prog.rs").run_fail(); | ||
} |
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,21 @@ | ||
// test.rs should produce both an rlib and a dylib | ||
// by default. When the crate_type flag is passed and | ||
// forced to dylib, no rlibs should be produced. | ||
// See https://github.com/rust-lang/rust/issues/11573 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{ | ||
cwd, dynamic_lib_name, fs_wrapper, has_extension, rust_lib_name, rustc, shallow_find_files, | ||
}; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
rustc().input("test.rs").run(); | ||
assert!(Path::new(&dynamic_lib_name("test")).exists()); | ||
assert!(Path::new(&rust_lib_name("test")).exists()); | ||
|
||
fs_wrapper::remove_file(rust_lib_name("test")); | ||
rustc().crate_type("dylib").input("test.rs").run(); | ||
assert!(shallow_find_files(cwd(), |path| { has_extension(path, "rlib") }).is_empty()); | ||
} |
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,27 @@ | ||
// In some cases, linking libraries with GNU used to fail due to how | ||
// `std` and `core` possess a circular dependency with one another, and | ||
// how the linker could not go back through its symbol processing to resolve | ||
// the circular link. #49316 fixed this, and this test reproduces a minimal | ||
// version of one such linking attempt which used to fail. | ||
// See https://github.com/rust-lang/rust/issues/18807 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{is_darwin, is_windows, rustc}; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").run(); | ||
|
||
let mut rustc_foo = rustc(); | ||
rustc_foo.input("foo.rs"); | ||
let mut rustc_foo_panic = rustc(); | ||
rustc_foo_panic.input("foo.rs").panic("abort"); | ||
|
||
if !is_darwin() && !is_windows() { | ||
rustc_foo.arg("-Clink-args=-Wl,--no-undefined"); | ||
rustc_foo_panic.arg("-Clink-args=-Wl,--no-undefined"); | ||
} | ||
|
||
rustc_foo.run(); | ||
rustc_foo_panic.run(); | ||
} |