-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #126745 - matthiaskrgr:rollup-xagplef, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #126095 (Migrate `link-args-order`, `ls-metadata` and `lto-readonly-lib` `run-make` tests to `rmake`) - #126629 (Migrate `run-make/compressed-debuginfo` to `rmake.rs`) - #126644 (Rewrite `extern-flag-rename-transitive`. `debugger-visualizer-dep-info`, `metadata-flag-frobs-symbols`, `extern-overrides-distribution` and `forced-unwind-terminate-pof` `run-make` tests to rmake) - #126735 (collect attrs in const block expr) - #126737 (Remove `feature(const_closures)` from libcore) - #126740 (add `needs-unwind` to UI test) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
25 changed files
with
216 additions
and
97 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 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 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 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,36 @@ | ||
// Checks the `debuginfo-compression` option. | ||
|
||
//@ only-linux | ||
//@ ignore-cross-compile | ||
|
||
// FIXME: This test isn't comprehensive and isn't covering all possible combinations. | ||
|
||
use run_make_support::{assert_contains, cmd, run_in_tmpdir, rustc}; | ||
|
||
fn check_compression(compression: &str, to_find: &str) { | ||
run_in_tmpdir(|| { | ||
let out = rustc() | ||
.crate_name("foo") | ||
.crate_type("lib") | ||
.emit("obj") | ||
.arg("-Cdebuginfo=full") | ||
.arg(&format!("-Zdebuginfo-compression={compression}")) | ||
.input("foo.rs") | ||
.run(); | ||
let stderr = out.stderr_utf8(); | ||
if stderr.is_empty() { | ||
// FIXME: `readelf` might need to be replaced with `llvm-readelf`. | ||
cmd("readelf").arg("-t").arg("foo.o").run().assert_stdout_contains(to_find); | ||
} else { | ||
assert_contains( | ||
&stderr, | ||
&format!("unknown debuginfo compression algorithm {compression}"), | ||
); | ||
} | ||
}); | ||
} | ||
|
||
fn main() { | ||
check_compression("zlib", "ZLIB"); | ||
check_compression("zstd", "ZSTD"); | ||
} |
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,11 @@ | ||
// This test checks that files referenced via #[debugger_visualizer] are | ||
// included in `--emit dep-info` output. | ||
// See https://github.com/rust-lang/rust/pull/111641 | ||
|
||
use run_make_support::{invalid_utf8_contains, rustc}; | ||
|
||
fn main() { | ||
rustc().emit("dep-info").input("main.rs").run(); | ||
invalid_utf8_contains("main.d", "foo.py"); | ||
invalid_utf8_contains("main.d", "my_visualizers/bar.natvis"); | ||
} |
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 @@ | ||
// In this test, baz.rs is looking for an extern crate "a" which | ||
// does not exist, and can only run through the --extern rustc flag | ||
// defining that the "a" crate is in fact just "foo". This test | ||
// checks that the --extern flag takes precedence over the extern | ||
// crate statement in the code. | ||
// See https://github.com/rust-lang/rust/pull/52723 | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
rustc().input("bar.rs").run(); | ||
rustc().input("baz.rs").extern_("a", rust_lib_name("foo")).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,14 @@ | ||
// The --extern flag should override any "crate_type" declarations in the | ||
// Rust files themselves. In this test, libc is compiled as "lib", but | ||
// main.rs will only run with an rlib, which checks if the --extern flag | ||
// is successfully overriding the default behaviour. | ||
// See https://github.com/rust-lang/rust/pull/21782 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("libc.rs").metadata("foo").run(); | ||
rustc().input("main.rs").extern_("libc", rust_lib_name("libc")).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,16 @@ | ||
// During a forced unwind, crossing the non-Plain Old Frame | ||
// would define the forced unwind as undefined behaviour, and | ||
// immediately abort the unwinding process. This test checks | ||
// that the forced unwinding takes precedence. | ||
// See https://github.com/rust-lang/rust/issues/101469 | ||
|
||
//@ ignore-cross-compile | ||
//@ ignore-windows | ||
//Reason: pthread (POSIX threads) is not available on Windows | ||
|
||
use run_make_support::{run, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
run("foo").assert_stdout_not_contains("cannot unwind"); | ||
} |
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,30 @@ | ||
// Passing linker arguments to the compiler used to be lost or reordered in a messy way | ||
// as they were passed further to the linker. This was fixed in #70665, and this test | ||
// checks that linker arguments remain intact and in the order they were originally passed in. | ||
// See https://github.com/rust-lang/rust/pull/70665 | ||
|
||
//@ ignore-msvc | ||
// Reason: the ld linker does not exist on Windows. | ||
|
||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc() | ||
.input("empty.rs") | ||
.linker_flavor("ld") | ||
.link_arg("a") | ||
.link_args("b c") | ||
.link_args("d e") | ||
.link_arg("f") | ||
.run_fail() | ||
.assert_stderr_contains(r#""a" "b" "c" "d" "e" "f""#); | ||
rustc() | ||
.input("empty.rs") | ||
.linker_flavor("ld") | ||
.arg("-Zpre-link-arg=a") | ||
.arg("-Zpre-link-args=b c") | ||
.arg("-Zpre-link-args=d e") | ||
.arg("-Zpre-link-arg=f") | ||
.run_fail() | ||
.assert_stderr_contains(r#""a" "b" "c" "d" "e" "f""#); | ||
} |
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 @@ | ||
// Passing invalid files to -Z ls (which lists the symbols | ||
// defined by a library crate) used to cause a segmentation fault. | ||
// As this was fixed in #11262, this test checks that no segfault | ||
// occurs when passing the invalid file `bar` to -Z ls. | ||
// See https://github.com/rust-lang/rust/issues/11259 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::fs_wrapper; | ||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").run(); | ||
rustc().arg("-Zls=root").input("foo").run(); | ||
fs_wrapper::create_file("bar"); | ||
rustc().arg("-Zls=root").input("bar").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,19 @@ | ||
// When the compiler is performing link time optimization, it will | ||
// need to copy the original rlib file, set the copy's permissions to read/write, | ||
// and modify that copy - even if the original | ||
// file is read-only. This test creates a read-only rlib, and checks that | ||
// compilation with LTO succeeds. | ||
// See https://github.com/rust-lang/rust/pull/17619 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::fs_wrapper; | ||
use run_make_support::{run, rust_lib_name, rustc, test_while_readonly}; | ||
|
||
fn main() { | ||
rustc().input("lib.rs").run(); | ||
test_while_readonly(rust_lib_name("lib"), || { | ||
rustc().input("main.rs").arg("-Clto").run(); | ||
run("main"); | ||
}); | ||
} |
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,20 @@ | ||
// In this test, foo.rs is compiled twice with different hashes tied to its | ||
// symbols thanks to the metadata flag. bar.rs then ensures that the memory locations | ||
// of foo's symbols are different even though they came from the same original source code. | ||
// This checks that the metadata flag is doing its job. | ||
// See https://github.com/rust-lang/rust/issues/14471 | ||
|
||
//@ ignore-cross-compile | ||
|
||
use run_make_support::{run, rust_lib_name, rustc}; | ||
|
||
fn main() { | ||
rustc().input("foo.rs").metadata("a").extra_filename("-a").run(); | ||
rustc().input("foo.rs").metadata("b").extra_filename("-b").run(); | ||
rustc() | ||
.input("bar.rs") | ||
.extern_("foo1", rust_lib_name("foo-a")) | ||
.extern_("foo2", rust_lib_name("foo-b")) | ||
.run(); | ||
run("bar"); | ||
} |
Oops, something went wrong.