From 97e45e0699e2fc8397b1e2cfb55743365d749b6e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 2 Mar 2021 11:04:35 +0100 Subject: [PATCH] make optimized-test-run a bit more like what cargo does --- ci.sh | 5 +++-- tests/compile-fail/data_race/dealloc_read_race_stack.rs | 3 +-- tests/compile-fail/data_race/dealloc_write_race_stack.rs | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ci.sh b/ci.sh index a1f4a0013946..3484040119ca 100755 --- a/ci.sh +++ b/ci.sh @@ -24,8 +24,9 @@ function run_tests { ./miri test --locked if [ -z "${MIRI_TEST_TARGET+exists}" ]; then - # Only for host architecture: tests with MIR optimizations - MIRIFLAGS="-Z mir-opt-level=3" ./miri test --locked + # Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR + # optimizations up all the way). + MIRIFLAGS="-O -Zmir-opt-level=3" ./miri test --locked fi # On Windows, there is always "python", not "python3" or "python2". diff --git a/tests/compile-fail/data_race/dealloc_read_race_stack.rs b/tests/compile-fail/data_race/dealloc_read_race_stack.rs index 281aff863146..6b573121e599 100644 --- a/tests/compile-fail/data_race/dealloc_read_race_stack.rs +++ b/tests/compile-fail/data_race/dealloc_read_race_stack.rs @@ -1,6 +1,5 @@ // ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -// With optimizations (in particular #78360), the span becomes much worse, so we disable them. +// compile-flags: -Zmiri-disable-isolation use std::thread::{spawn, sleep}; use std::ptr::null_mut; diff --git a/tests/compile-fail/data_race/dealloc_write_race_stack.rs b/tests/compile-fail/data_race/dealloc_write_race_stack.rs index 55aaa0c1635a..34a16b00b83d 100644 --- a/tests/compile-fail/data_race/dealloc_write_race_stack.rs +++ b/tests/compile-fail/data_race/dealloc_write_race_stack.rs @@ -1,6 +1,5 @@ // ignore-windows: Concurrency on Windows is not supported yet. -// compile-flags: -Zmiri-disable-isolation -Zmir-opt-level=0 -// With optimizations (in particular #78360), the span becomes much worse, so we disable them. +// compile-flags: -Zmiri-disable-isolation use std::thread::{spawn, sleep}; use std::ptr::null_mut;