os-rust/tests/run-make/sepcomp-separate/rmake.rs
许杰友 Jieyou Xu (Joe) d69cc1ccbf tests: update for rfs rename
2024-07-17 13:34:18 +00:00

15 lines
624 B
Rust

// Test that separate compilation actually puts code into separate compilation
// units. `foo.rs` defines `magic_fn` in three different modules, which should
// wind up in three different compilation units.
// See https://github.com/rust-lang/rust/pull/16367
use run_make_support::{
count_regex_matches_in_files_with_extension, cwd, has_extension, regex, rfs, rustc,
shallow_find_files,
};
fn main() {
rustc().input("foo.rs").emit("llvm-ir").codegen_units(3).run();
let re = regex::Regex::new(r#"define\ .*magic_fn"#).unwrap();
assert_eq!(count_regex_matches_in_files_with_extension(&re, "ll"), 3);
}