2024-06-22 05:35:58 -05:00
|
|
|
use std::ffi::OsStr;
|
|
|
|
|
2024-07-28 17:13:50 -05:00
|
|
|
use run_make_support::regex::Regex;
|
|
|
|
use run_make_support::{rfs, rustc};
|
|
|
|
|
2024-06-22 05:35:58 -05:00
|
|
|
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;
|
2024-07-17 07:42:06 -05:00
|
|
|
rfs::read_dir_entries(".", |path| {
|
2024-06-22 05:35:58 -05:00
|
|
|
if path.is_file() && path.extension().is_some_and(|ext| ext == OsStr::new("ll")) {
|
2024-07-17 07:42:06 -05:00
|
|
|
assert!(!re.is_match(&rfs::read_to_string(path)));
|
2024-06-22 05:35:58 -05:00
|
|
|
nb_ll += 1;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
assert!(nb_ll > 0);
|
|
|
|
}
|