mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 20:43:03 +00:00
parent
503dfcf4e0
commit
91f5530b2d
@ -107,6 +107,13 @@ impl Rustc {
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify path to the output directory. Equivalent to `--out-dir`` in rustc.
|
||||
pub fn out_dir<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
|
||||
self.cmd.arg("--out-dir");
|
||||
self.cmd.arg(path.as_ref());
|
||||
self
|
||||
}
|
||||
|
||||
/// This flag defers LTO optimizations to the linker.
|
||||
pub fn linker_plugin_lto(&mut self, option: &str) -> &mut Self {
|
||||
self.cmd.arg(format!("-Clinker-plugin-lto={option}"));
|
||||
|
@ -122,7 +122,6 @@ run-make/link-framework/Makefile
|
||||
run-make/link-path-order/Makefile
|
||||
run-make/linkage-attr-on-static/Makefile
|
||||
run-make/llvm-ident/Makefile
|
||||
run-make/llvm-outputs/Makefile
|
||||
run-make/long-linker-command-lines-cmd-exe/Makefile
|
||||
run-make/long-linker-command-lines/Makefile
|
||||
run-make/longjmp-across-rust/Makefile
|
||||
|
@ -1,5 +0,0 @@
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
echo 'fn main() {}' | $(BARE_RUSTC) - --out-dir=$(TMPDIR)/random_directory_that_does_not_exist_ir/ --emit=llvm-ir
|
||||
echo 'fn main() {}' | $(BARE_RUSTC) - --out-dir=$(TMPDIR)/random_directory_that_does_not_exist_bc/ --emit=llvm-bc
|
20
tests/run-make/llvm-outputs/rmake.rs
Normal file
20
tests/run-make/llvm-outputs/rmake.rs
Normal file
@ -0,0 +1,20 @@
|
||||
// test that directories get created when emitting llvm bitcode and IR
|
||||
|
||||
use run_make_support::{cwd, run_in_tmpdir, rustc};
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
let mut path_bc = PathBuf::new();
|
||||
let mut path_ir = PathBuf::new();
|
||||
run_in_tmpdir(|| {
|
||||
let p = cwd();
|
||||
path_bc = p.join("nonexistant_dir_bc");
|
||||
path_ir = p.join("nonexistant_dir_ir");
|
||||
rustc().input("-").stdin("fn main() {}").out_dir(&path_bc).emit("llvm-bc").run();
|
||||
rustc().input("-").stdin("fn main() {}").out_dir(&path_ir).emit("llvm-ir").run();
|
||||
assert!(path_bc.exists());
|
||||
assert!(path_ir.exists());
|
||||
});
|
||||
assert!(!path_bc.exists());
|
||||
assert!(!path_ir.exists());
|
||||
}
|
Loading…
Reference in New Issue
Block a user