@@ -27,13 +27,17 @@ fn run_pass() {
27
27
compiletest:: run_tests ( & config) ;
28
28
}
29
29
30
- fn miri_pass ( path : & str , target : & str , host : & str ) {
30
+ fn miri_pass ( path : & str , target : & str , host : & str , fullmir : bool ) {
31
31
let mut config = compiletest:: default_config ( ) ;
32
32
config. mode = "mir-opt" . parse ( ) . expect ( "Invalid mode" ) ;
33
33
config. src_base = PathBuf :: from ( path) ;
34
34
config. target = target. to_owned ( ) ;
35
35
config. host = host. to_owned ( ) ;
36
36
config. rustc_path = PathBuf :: from ( "target/debug/miri" ) ;
37
+ if fullmir {
38
+ let sysroot = Path :: new ( & std:: env:: var ( "HOME" ) . unwrap ( ) ) . join ( ".xargo" ) . join ( "HOST" ) ;
39
+ config. target_rustcflags = Some ( format ! ( "--sysroot {}" , sysroot. to_str( ) . unwrap( ) ) ) ;
40
+ }
37
41
// don't actually execute the final binary, it might be for other targets and we only care
38
42
// about running miri, not the binary.
39
43
config. runtool = Some ( "echo \" \" || " . to_owned ( ) ) ;
@@ -116,6 +120,7 @@ fn compile_test() {
116
120
let sysroot = libs. join ( "rustlib" ) . join ( & host) . join ( "lib" ) ;
117
121
let paths = std:: env:: join_paths ( & [ libs, sysroot] ) . unwrap ( ) ;
118
122
cmd. env ( compiletest:: procsrv:: dylib_env_var ( ) , paths) ;
123
+ cmd. env ( "MIRI_SYSROOT" , Path :: new ( & std:: env:: var ( "HOME" ) . unwrap ( ) ) . join ( ".xargo" ) . join ( "HOST" ) ) ;
119
124
120
125
match cmd. output ( ) {
121
126
Ok ( ref output) if output. status . success ( ) => {
@@ -197,8 +202,9 @@ fn compile_test() {
197
202
} else {
198
203
run_pass ( ) ;
199
204
for_all_targets ( sysroot, |target| {
200
- miri_pass ( "tests/run-pass" , & target, host) ;
205
+ miri_pass ( "tests/run-pass" , & target, host, false ) ;
201
206
} ) ;
207
+ miri_pass ( "tests/run-pass-fullmir" , host, host, true ) ;
202
208
compile_fail ( sysroot) ;
203
209
}
204
210
}
0 commit comments