diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-07-08 20:23:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-08 20:23:39 +0200 |
| commit | 485a861a9f894fc19b6fa4e3c21cde577e8aa4c9 (patch) | |
| tree | 61df5164c3b5d9a32266afa7f9ed0d1b46357d22 | |
| parent | 9804cf9b5db2037734deab463ae8e1df56c8ea62 (diff) | |
| parent | aa1c24a908fb7c37b9ed2998e240f06101050047 (diff) | |
| download | rust-485a861a9f894fc19b6fa4e3c21cde577e8aa4c9.tar.gz rust-485a861a9f894fc19b6fa4e3c21cde577e8aa4c9.zip | |
Rollup merge of #127237 - GuillaumeGomez:improve-run-make-llvm-ident, r=Kobzol
Improve code of `run-make/llvm-ident` Follow-up of https://github.com/rust-lang/rust/pull/126941. r? `@Kobzol`
| -rw-r--r-- | tests/run-make/llvm-ident/rmake.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/run-make/llvm-ident/rmake.rs b/tests/run-make/llvm-ident/rmake.rs index 6934a4b36d0..9699d0579f6 100644 --- a/tests/run-make/llvm-ident/rmake.rs +++ b/tests/run-make/llvm-ident/rmake.rs @@ -2,9 +2,9 @@ //@ ignore-cross-compile use run_make_support::llvm::llvm_bin_dir; -use run_make_support::{cmd, env_var, llvm_filecheck, read_dir, rustc, source_root}; - -use std::ffi::OsStr; +use run_make_support::{ + cmd, env_var, has_extension, llvm_filecheck, rustc, shallow_find_files, source_root, +}; fn main() { // `-Ccodegen-units=16 -Copt-level=2` is used here to trigger thin LTO @@ -22,20 +22,14 @@ fn main() { // `llvm-dis` is used here since `--emit=llvm-ir` does not emit LLVM IR // for temporary outputs. - let mut files = Vec::new(); - read_dir(".", |path| { - if path.is_file() && path.extension().is_some_and(|ext| ext == OsStr::new("bc")) { - files.push(path.to_path_buf()); - } - }); + let files = shallow_find_files(".", |path| has_extension(path, "bc")); cmd(llvm_bin_dir().join("llvm-dis")).args(files).run(); // Check LLVM IR files (including temporary outputs) have `!llvm.ident` // named metadata, reusing the related codegen test. let llvm_ident_path = source_root().join("tests/codegen/llvm-ident.rs"); - read_dir(".", |path| { - if path.is_file() && path.extension().is_some_and(|ext| ext == OsStr::new("ll")) { - llvm_filecheck().input_file(path).arg(&llvm_ident_path).run(); - } - }); + let files = shallow_find_files(".", |path| has_extension(path, "ll")); + for file in files { + llvm_filecheck().input_file(file).arg(&llvm_ident_path).run(); + } } |
