-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #126712 - Oneirical:bootest-constestllation, r=jieyouxu
Migrate `relocation-model`, `error-writing-dependencies` and `crate-name-priority` `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 MSVC try-job due to #28026, almost guaranteed to fail, but let's see anyways. try-job: aarch64-gnu `/* try-job: x86_64-msvc */` try-job: x86_64-apple-1 try-job: armhf-gnu try-job: test-various
- Loading branch information
Showing
7 changed files
with
59 additions
and
43 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,18 @@ | ||
// The `crate_name` rustc flag should have higher priority | ||
// over `#![crate_name = "foo"]` defined inside the source code. | ||
// This test has a conflict between crate_names defined in the .rs files | ||
// and the compiler flags, and checks that the flag is favoured each time. | ||
// See https://github.com/rust-lang/rust/pull/15518 | ||
|
||
use run_make_support::{bin_name, fs_wrapper, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
fs_wrapper::remove_file(bin_name("foo")); | ||
rustc().input("foo.rs").crate_name("bar").run(); | ||
fs_wrapper::remove_file(bin_name("bar")); | ||
rustc().input("foo1.rs").run(); | ||
fs_wrapper::remove_file(bin_name("foo")); | ||
rustc().input("foo1.rs").output(bin_name("bar1")).run(); | ||
fs_wrapper::remove_file(bin_name("bar1")); | ||
} |
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 @@ | ||
// Invalid paths passed to rustc used to cause internal compilation errors | ||
// alongside an obscure error message. This was turned into a standard error, | ||
// and this test checks that the cleaner error message is printed instead. | ||
// See https://github.com/rust-lang/rust/issues/13517 | ||
|
||
use run_make_support::rustc; | ||
|
||
// NOTE: This cannot be a UI test due to the --out-dir flag, which is | ||
// already present by default in UI testing. | ||
|
||
fn main() { | ||
let out = rustc().input("foo.rs").emit("dep-info").out_dir("foo/bar/baz").run_fail(); | ||
// The error message should be informative. | ||
out.assert_stderr_contains("error writing dependencies"); | ||
// The filename should appear. | ||
out.assert_stderr_contains("baz"); | ||
} |
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,24 @@ | ||
// Generation of position-independent code (PIC) can be altered | ||
// through use of the -C relocation-model rustc flag. This test | ||
// uses varied values with this flag and checks that compilation | ||
// succeeds. | ||
// See https://github.com/rust-lang/rust/pull/13340 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().arg("-Crelocation-model=static").input("foo.rs").run(); | ||
run("foo"); | ||
rustc().arg("-Crelocation-model=dynamic-no-pic").input("foo.rs").run(); | ||
run("foo"); | ||
rustc().arg("-Crelocation-model=default").input("foo.rs").run(); | ||
run("foo"); | ||
rustc() | ||
.arg("-Crelocation-model=dynamic-no-pic") | ||
.crate_type("dylib") | ||
.emit("link,obj") | ||
.input("foo.rs") | ||
.run(); | ||
} |