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

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

13 lines
330 B
Rust
Raw Normal View History

2023-04-23 11:15:22 -05:00
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: DataflowConstProp
// compile-flags: -Zmir-enable-passes=+InstSimplify
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR slice_len.main.DataflowConstProp.diff
fn main() {
2023-09-07 10:59:05 -05:00
let local = (&[1u32, 2, 3] as &[u32])[1];
const SLICE: &[u32] = &[1, 2, 3];
let constant = SLICE[1];
2023-04-23 11:15:22 -05:00
}