18 lines
789 B
Rust
18 lines
789 B
Rust
// Check that cross-crate inlined items are inlined in all compilation units
|
|
// that refer to them, and not in any other compilation units.
|
|
// Note that we have to pass `-C codegen-units=6` because up to two CGUs may be
|
|
// created for each source module (see `rustc_const_eval::monomorphize::partitioning`).
|
|
// 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("cci_lib.rs").run();
|
|
rustc().input("foo.rs").emit("llvm-ir").codegen_units(6).arg("-Zinline-in-all-cgus").run();
|
|
let re = regex::Regex::new(r#"define\ .*cci_fn"#).unwrap();
|
|
assert_eq!(count_regex_matches_in_files_with_extension(&re, "ll"), 2);
|
|
}
|