rust/tests/run-make/emit-named-files/rmake.rs

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

25 lines
794 B
Rust
Raw Normal View History

use std::path::Path;
2024-07-17 08:31:38 -05:00
use run_make_support::{rfs, rustc};
fn emit_and_check(out_dir: &Path, out_file: &str, format: &str) {
let out_file = out_dir.join(out_file);
rustc().input("foo.rs").emit(format!("{format}={}", out_file.display())).run();
assert!(out_file.is_file());
}
fn main() {
let out_dir = Path::new("emit");
rfs::create_dir(&out_dir);
emit_and_check(&out_dir, "libfoo.s", "asm");
emit_and_check(&out_dir, "libfoo.bc", "llvm-bc");
emit_and_check(&out_dir, "libfoo.ll", "llvm-ir");
emit_and_check(&out_dir, "libfoo.o", "obj");
emit_and_check(&out_dir, "libfoo.rmeta", "metadata");
emit_and_check(&out_dir, "libfoo.rlib", "link");
emit_and_check(&out_dir, "libfoo.d", "dep-info");
emit_and_check(&out_dir, "libfoo.mir", "mir");
}