From cd89e56f152798ef437377acd7d503dae2b3cb99 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Sun, 18 Mar 2018 13:18:41 +0100 Subject: [PATCH] Get the tests one step further --- miri/fn_call.rs | 6 ++++-- tests/compiletest.rs | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/miri/fn_call.rs b/miri/fn_call.rs index d5d77c5d3259..70b4900a4eff 100644 --- a/miri/fn_call.rs +++ b/miri/fn_call.rs @@ -106,7 +106,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' let def_id = instance.def_id(); let item_path = self.tcx.absolute_item_path_str(def_id); if item_path.starts_with("std::") { - println!("{}", item_path); + //println!("{}", item_path); } match &*item_path { "std::sys::unix::thread::guard::init" | "std::sys::unix::thread::guard::current" => { @@ -118,7 +118,9 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' let none_variant_index = adt_def.variants.iter().enumerate().find(|&(_i, ref def)| { def.name.as_str() == "None" }).expect("No None variant").0; - write_discriminant_value(self, ret_ty, destination.unwrap().0, none_variant_index)?; + let (return_place, return_to_block) = destination.unwrap(); + write_discriminant_value(self, ret_ty, return_place, none_variant_index)?; + self.goto_block(return_to_block); return Ok(true); } _ => panic!("Unexpected return type for {}", item_path) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index b1ea3fc8b0d4..e2e00d828c1a 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -53,10 +53,10 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b let sysroot = std::env::home_dir().unwrap() .join(".xargo") .join("HOST"); - config.target_rustcflags = Some(format!("--sysroot {}", sysroot.to_str().unwrap())); + flags.push(format!("--sysroot {}", sysroot.to_str().unwrap())); config.src_base = PathBuf::from(path.to_string()); } else { - config.target_rustcflags = Some(format!("--sysroot {}", sysroot.to_str().unwrap())); + flags.push(format!("--sysroot {}", sysroot.to_str().unwrap())); config.src_base = PathBuf::from(path.to_string()); } flags.push("-Zmir-emit-validate=1".to_owned()); @@ -206,8 +206,8 @@ fn compile_fail_miri() { let sysroot = get_sysroot(); let host = get_host(); - for_all_targets(&sysroot, |target| { - compile_fail(&sysroot, "tests/compile-fail", &target, &host, false); - }); + // FIXME: run tests for other targets, too + compile_fail(&sysroot, "tests/compile-fail", &host, &host, true); + compile_fail(&sysroot, "tests/compile-fail-fullmir", &host, &host, true); }