forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrmake.rs
More file actions
17 lines (15 loc) · 796 Bytes
/
rmake.rs
File metadata and controls
17 lines (15 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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, fs_wrapper, has_extension, regex, 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);
}