Skip to content

Commit

Permalink
Disable MIR optimizations in tests (#1507)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli authored Mar 6, 2024
1 parent daf0e86 commit 528f4c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion prusti-tests/tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ fn run_prusti_tests(group_name: &str, filter: &Option<String>, rustc_flags: Opti
}

// Add compilation flags
config.target_rustcflags = Some(format!("--edition=2018 {}", rustc_flags.unwrap_or("")));
// mir-opt-level=0 disables MIR optimizations (e.g., const propagation) that might hide bugs.
config.target_rustcflags = Some(format!(
"--edition=2018 -Z mir-opt-level=0 {}",
rustc_flags.unwrap_or("")
));

let path: PathBuf = ["tests", group_name, "ui"].iter().collect();
if path.exists() {
Expand Down

0 comments on commit 528f4c2

Please sign in to comment.