diff options
Diffstat (limited to 'tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs')
-rw-r--r-- | tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs | 17 |
1 files changed, 17 insertions, 0 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 new file mode 100644 index 000000000..dfeccd3eb --- /dev/null +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs @@ -0,0 +1,17 @@ +// unit-test: DataflowConstProp +// compile-flags: -Zmir-enable-passes=+ConstProp,+Inline +// ignore-debug assertions change the output MIR +// EMIT_MIR_FOR_EACH_BIT_WIDTH +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY + +struct A { + foo: Box<[bool]>, +} + +// EMIT_MIR default_boxed_slice.main.ConstProp.diff +// EMIT_MIR default_boxed_slice.main.DataflowConstProp.diff +fn main() { + // ConstProp will create a constant of type `Box<[bool]>`. + // Verify that `DataflowConstProp` does not ICE trying to dereference it directly. + let a: A = A { foo: Box::default() }; +} |