Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make crashes dump mir to build dir
  • Loading branch information
compiler-errors committed May 12, 2024
commit 848f3c2c6e65c799bb87e5f0308ad7556f7e7fcb
22 changes: 14 additions & 8 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,15 @@ impl<'test> TestCx<'test> {
}
}

let set_mir_dump_dir = |rustc: &mut Command| {
let mir_dump_dir = self.get_mir_dump_dir();
remove_and_create_dir_all(&mir_dump_dir);
let mut dir_opt = "-Zdump-mir-dir=".to_string();
dir_opt.push_str(mir_dump_dir.to_str().unwrap());
debug!("dir_opt: {:?}", dir_opt);
rustc.arg(dir_opt);
};

match self.config.mode {
Incremental => {
// If we are extracting and matching errors in the new
Expand Down Expand Up @@ -2532,13 +2541,7 @@ impl<'test> TestCx<'test> {
]);
}

let mir_dump_dir = self.get_mir_dump_dir();
remove_and_create_dir_all(&mir_dump_dir);
let mut dir_opt = "-Zdump-mir-dir=".to_string();
dir_opt.push_str(mir_dump_dir.to_str().unwrap());
debug!("dir_opt: {:?}", dir_opt);

rustc.arg(dir_opt);
set_mir_dump_dir(&mut rustc);
}
CoverageMap => {
rustc.arg("-Cinstrument-coverage");
Expand All @@ -2560,8 +2563,11 @@ impl<'test> TestCx<'test> {
Assembly | Codegen => {
rustc.arg("-Cdebug-assertions=no");
}
Crashes => {
set_mir_dump_dir(&mut rustc);
}
RunPassValgrind | Pretty | DebugInfo | Rustdoc | RustdocJson | RunMake
| CodegenUnits | JsDocTest | Crashes => {
| CodegenUnits | JsDocTest => {
// do not use JSON output
}
}
Expand Down