rust/tests/run-make/sepcomp-separate/rmake.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
568 B
Rust
Raw Permalink Normal View History

2024-06-12 10:24:21 -05:00
// 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
2024-08-10 13:06:10 -05:00
use run_make_support::{count_regex_matches_in_files_with_extension, regex, rustc};
2024-06-12 10:24:21 -05:00
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);
2024-06-12 10:24:21 -05:00
}