mark rust-lld-compress-debug-sections
test as needing zstd
also make it fail if there's a compression issue
This commit is contained in:
parent
5b374631df
commit
79f3c51a01
1 changed files with 4 additions and 14 deletions
|
@ -1,12 +1,13 @@
|
||||||
// Checks the `compress-debug-sections` option on rust-lld.
|
// Checks the `compress-debug-sections` option on rust-lld.
|
||||||
|
|
||||||
//@ needs-rust-lld
|
//@ needs-rust-lld
|
||||||
|
//@ needs-llvm-zstd
|
||||||
//@ only-linux
|
//@ only-linux
|
||||||
//@ ignore-cross-compile
|
//@ ignore-cross-compile
|
||||||
|
|
||||||
// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
|
// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
|
||||||
|
|
||||||
use run_make_support::{assert_contains, llvm_readobj, run_in_tmpdir, rustc};
|
use run_make_support::{llvm_readobj, run_in_tmpdir, rustc};
|
||||||
|
|
||||||
fn check_compression(compression: &str, to_find: &str) {
|
fn check_compression(compression: &str, to_find: &str) {
|
||||||
run_in_tmpdir(|| {
|
run_in_tmpdir(|| {
|
||||||
|
@ -17,19 +18,8 @@ fn check_compression(compression: &str, to_find: &str) {
|
||||||
.arg("-Cdebuginfo=full")
|
.arg("-Cdebuginfo=full")
|
||||||
.link_arg(&format!("-Wl,--compress-debug-sections={compression}"))
|
.link_arg(&format!("-Wl,--compress-debug-sections={compression}"))
|
||||||
.input("main.rs")
|
.input("main.rs")
|
||||||
.run_unchecked();
|
.run();
|
||||||
let stderr = out.stderr_utf8();
|
llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find);
|
||||||
if stderr.is_empty() {
|
|
||||||
llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find);
|
|
||||||
} else {
|
|
||||||
assert_contains(
|
|
||||||
stderr,
|
|
||||||
format!(
|
|
||||||
"LLVM was not built with LLVM_ENABLE_{to_find} \
|
|
||||||
or did not find {compression} at build time"
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue