rust/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
566 B
Rust
Raw Normal View History

// skip-filecheck
// unit-test: DataflowConstProp
2023-09-20 16:43:33 -05:00
// compile-flags: -Zmir-enable-passes=+GVN,+Inline
2023-09-20 13:18:44 -05:00
// ignore-debug assertions change the output MIR
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
struct A {
foo: Box<[bool]>,
}
2023-09-20 16:43:33 -05:00
// EMIT_MIR default_boxed_slice.main.GVN.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() };
}