4 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,13 @@ impl Rustc {
107
107
self
108
108
}
109
109
110
+ /// Specify path to the output directory. Equivalent to `--out-dir`` in rustc.
111
+ pub fn out_dir < P : AsRef < Path > > ( & mut self , path : P ) -> & mut Self {
112
+ self . cmd . arg ( "--out-dir" ) ;
113
+ self . cmd . arg ( path. as_ref ( ) ) ;
114
+ self
115
+ }
116
+
110
117
/// This flag defers LTO optimizations to the linker.
111
118
pub fn linker_plugin_lto ( & mut self , option : & str ) -> & mut Self {
112
119
self . cmd . arg ( format ! ( "-Clinker-plugin-lto={option}" ) ) ;
Original file line number Diff line number Diff line change @@ -122,7 +122,6 @@ run-make/link-framework/Makefile
122
122
run-make/link-path-order/Makefile
123
123
run-make/linkage-attr-on-static/Makefile
124
124
run-make/llvm-ident/Makefile
125
- run-make/llvm-outputs/Makefile
126
125
run-make/long-linker-command-lines-cmd-exe/Makefile
127
126
run-make/long-linker-command-lines/Makefile
128
127
run-make/longjmp-across-rust/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // test that directories get created when emitting llvm bitcode and IR
2
+
3
+ use run_make_support:: { cwd, run_in_tmpdir, rustc} ;
4
+ use std:: path:: PathBuf ;
5
+
6
+ fn main ( ) {
7
+ let mut path_bc = PathBuf :: new ( ) ;
8
+ let mut path_ir = PathBuf :: new ( ) ;
9
+ run_in_tmpdir ( || {
10
+ let p = cwd ( ) ;
11
+ path_bc = p. join ( "nonexistant_dir_bc" ) ;
12
+ path_ir = p. join ( "nonexistant_dir_ir" ) ;
13
+ rustc ( ) . input ( "-" ) . stdin ( "fn main() {}" ) . out_dir ( & path_bc) . emit ( "llvm-bc" ) . run ( ) ;
14
+ rustc ( ) . input ( "-" ) . stdin ( "fn main() {}" ) . out_dir ( & path_ir) . emit ( "llvm-ir" ) . run ( ) ;
15
+ assert ! ( path_bc. exists( ) ) ;
16
+ assert ! ( path_ir. exists( ) ) ;
17
+ } ) ;
18
+ assert ! ( !path_bc. exists( ) ) ;
19
+ assert ! ( !path_ir. exists( ) ) ;
20
+ }
0 commit comments