Skip to content

Commit ccd9784

Browse files
committed
mark rust-lld-compress-debug-sections test as needing zstd
also make it fail if there's a compression issue
1 parent b5a7559 commit ccd9784

File tree

1 file changed

+4
-14
lines changed
  • tests/run-make/rust-lld-compress-debug-sections

1 file changed

+4
-14
lines changed

tests/run-make/rust-lld-compress-debug-sections/rmake.rs

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Checks the `compress-debug-sections` option on rust-lld.
22

33
//@ needs-rust-lld
4+
//@ needs-llvm-zstd
45
//@ only-linux
56
//@ ignore-cross-compile
67

78
// FIXME: This test isn't comprehensive and isn't covering all possible combinations.
89

9-
use run_make_support::{assert_contains, cmd, llvm_readobj, run_in_tmpdir, rustc};
10+
use run_make_support::{llvm_readobj, run_in_tmpdir, rustc};
1011

1112
fn check_compression(compression: &str, to_find: &str) {
1213
run_in_tmpdir(|| {
@@ -17,19 +18,8 @@ fn check_compression(compression: &str, to_find: &str) {
1718
.arg("-Cdebuginfo=full")
1819
.link_arg(&format!("-Wl,--compress-debug-sections={compression}"))
1920
.input("main.rs")
20-
.run_unchecked();
21-
let stderr = out.stderr_utf8();
22-
if stderr.is_empty() {
23-
llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find);
24-
} else {
25-
assert_contains(
26-
stderr,
27-
format!(
28-
"LLVM was not built with LLVM_ENABLE_{to_find} \
29-
or did not find {compression} at build time"
30-
),
31-
);
32-
}
21+
.run();
22+
llvm_readobj().arg("-t").arg("main").run().assert_stdout_contains(to_find);
3323
});
3424
}
3525

0 commit comments

Comments
 (0)