mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Rollup merge of #126823 - GuillaumeGomez:migrate-run-make-inline-always-many-cgu, r=Kobzol
Migrate `run-make/inline-always-many-cgu` to `rmake.rs` Part of https://github.com/rust-lang/rust/issues/121876. r? `@jieyouxu`
This commit is contained in:
commit
d265538016
@ -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());
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ run-make/foreign-rust-exceptions/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
|
||||
|
@ -1,8 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs --emit llvm-ir -C codegen-units=2
|
||||
if cat $(TMPDIR)/*.ll | $(CGREP) -e '\bcall\b'; then \
|
||||
echo "found call instruction when one wasn't expected"; \
|
||||
exit 1; \
|
||||
fi
|
18
tests/run-make/inline-always-many-cgu/rmake.rs
Normal file
18
tests/run-make/inline-always-many-cgu/rmake.rs
Normal file
@ -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…
Reference in New Issue
Block a user