Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate run-make/inline-always-many-cgu to rmake.rs #126823

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ pub fn recursive_diff(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
});
}

pub fn read_dir<F: Fn(&Path)>(dir: impl AsRef<Path>, callback: F) {
pub fn read_dir<F: FnMut(&Path)>(dir: impl AsRef<Path>, mut callback: F) {
for entry in fs_wrapper::read_dir(dir) {
callback(&entry.unwrap().path());
}
Expand Down
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ run-make/glibc-staticlib-args/Makefile
run-make/include_bytes_deps/Makefile
run-make/incr-add-rust-src-component/Makefile
run-make/incr-foreign-head-span/Makefile
run-make/inline-always-many-cgu/Makefile
run-make/interdependent-c-libraries/Makefile
run-make/intrinsic-unreachable/Makefile
run-make/invalid-library/Makefile
Expand Down
8 changes: 0 additions & 8 deletions tests/run-make/inline-always-many-cgu/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/inline-always-many-cgu/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use run_make_support::fs_wrapper::read_to_string;
use run_make_support::regex::Regex;
use run_make_support::{read_dir, rustc};

use std::ffi::OsStr;

fn main() {
rustc().input("foo.rs").emit("llvm-ir").codegen_units(2).run();
let re = Regex::new(r"\bcall\b").unwrap();
let mut nb_ll = 0;
read_dir(".", |path| {
if path.is_file() && path.extension().is_some_and(|ext| ext == OsStr::new("ll")) {
assert!(!re.is_match(&read_to_string(path)));
nb_ll += 1;
}
});
assert!(nb_ll > 0);
}
Loading