From 07994c9310f61f119c5266dfd8119d7d66c2becf Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 22 Mar 2024 08:00:12 -0400 Subject: [PATCH] Enable more mir-opt tests in debug builds --- tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs | 1 - tests/mir-opt/funky_arms.rs | 1 - tests/mir-opt/inline/unchecked_shifts.rs | 1 - tests/mir-opt/inline/unwrap_unchecked.rs | 3 +-- tests/mir-opt/pre-codegen/duplicate_switch_targets.rs | 1 - tests/mir-opt/pre-codegen/mem_replace.rs | 2 +- tests/mir-opt/pre-codegen/slice_index.rs | 1 - tests/mir-opt/pre-codegen/slice_iter.rs | 1 - 8 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs index 9986d903501bd..617501217cf47 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs @@ -1,6 +1,5 @@ //@ unit-test: DataflowConstProp //@ compile-flags: -Zmir-enable-passes=+GVN,+Inline -//@ ignore-debug assertions change the output MIR // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/funky_arms.rs b/tests/mir-opt/funky_arms.rs index 189cd7951fb7c..fc3691049eb4a 100644 --- a/tests/mir-opt/funky_arms.rs +++ b/tests/mir-opt/funky_arms.rs @@ -1,6 +1,5 @@ // skip-filecheck // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ compile-flags: --crate-type lib -Cdebug-assertions=no #![feature(flt2dec)] diff --git a/tests/mir-opt/inline/unchecked_shifts.rs b/tests/mir-opt/inline/unchecked_shifts.rs index 2fd18f3d5ebe8..12b00e76a11b5 100644 --- a/tests/mir-opt/inline/unchecked_shifts.rs +++ b/tests/mir-opt/inline/unchecked_shifts.rs @@ -2,7 +2,6 @@ #![crate_type = "lib"] #![feature(unchecked_shifts)] -//@ ignore-debug: the debug assertions prevent the inlining we are testing for //@ compile-flags: -Zmir-opt-level=2 -Zinline-mir // EMIT_MIR unchecked_shifts.unchecked_shl_unsigned_smaller.Inline.diff diff --git a/tests/mir-opt/inline/unwrap_unchecked.rs b/tests/mir-opt/inline/unwrap_unchecked.rs index e44e4e23a2c07..13c76c5bb53e4 100644 --- a/tests/mir-opt/inline/unwrap_unchecked.rs +++ b/tests/mir-opt/inline/unwrap_unchecked.rs @@ -1,8 +1,7 @@ #![crate_type = "lib"] // EMIT_MIR_FOR_EACH_PANIC_STRATEGY -//@ ignore-debug: the debug assertions prevent the inlining we are testing for -//@ compile-flags: -Zmir-opt-level=2 -Zinline-mir -Cdebug-assertions=no +//@ compile-flags: -Zmir-opt-level=2 -Zinline-mir // EMIT_MIR unwrap_unchecked.unwrap_unchecked.Inline.diff // EMIT_MIR unwrap_unchecked.unwrap_unchecked.PreCodegen.after.mir diff --git a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs index 67540676f4a5a..561bafa96516d 100644 --- a/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs +++ b/tests/mir-opt/pre-codegen/duplicate_switch_targets.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -Zmir-opt-level=2 -Cdebuginfo=0 -//@ ignore-debug: standard library debug assertions add a panic that breaks this optimization #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/mem_replace.rs b/tests/mir-opt/pre-codegen/mem_replace.rs index 9cb3a83995654..a68fe31f6094d 100644 --- a/tests/mir-opt/pre-codegen/mem_replace.rs +++ b/tests/mir-opt/pre-codegen/mem_replace.rs @@ -1,6 +1,6 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -Zinline-mir -//@ ignore-debug the standard library debug assertions leak into this test +//@ ignore-debug: precondition checks on ptr::read/write are under cfg(debug_assertions) // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/slice_index.rs b/tests/mir-opt/pre-codegen/slice_index.rs index 1d977ee92148f..c9dd72d8be2a8 100644 --- a/tests/mir-opt/pre-codegen/slice_index.rs +++ b/tests/mir-opt/pre-codegen/slice_index.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"] diff --git a/tests/mir-opt/pre-codegen/slice_iter.rs b/tests/mir-opt/pre-codegen/slice_iter.rs index 0fbd370654485..86f37ca4d1358 100644 --- a/tests/mir-opt/pre-codegen/slice_iter.rs +++ b/tests/mir-opt/pre-codegen/slice_iter.rs @@ -1,6 +1,5 @@ // skip-filecheck //@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 -//@ ignore-debug the standard library debug assertions leak into this test // EMIT_MIR_FOR_EACH_PANIC_STRATEGY #![crate_type = "lib"]