rust/tests/mir-opt/dataflow-const-prop/large_array_index.rs
Michael Goulet 057313b7a6 Reapply "Auto merge of #133734 - scottmcm:lower-indexing-to-ptrmetadata, r=davidtwco,RalfJung"
This reverts commit 122a55bb442bd1995df9cf9b36e6f65ed3ef4a1d.
2025-01-27 23:42:47 +00:00

19 lines
550 B
Rust

//@ test-mir-pass: DataflowConstProp
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR large_array_index.main.DataflowConstProp.diff
// CHECK-LABEL: fn main(
fn main() {
// check that we don't propagate this, because it's too large
// CHECK: debug x => [[x:_.*]];
// CHECK: [[array_lit:_.*]] = [const 0_u8; 5000];
// CHECK: {{_.*}} = const 2_usize;
// CHECK: {{_.*}} = const true;
// CHECK: assert(const true
// CHECK: [[x]] = copy [[array_lit]][2 of 3];
let x: u8 = [0_u8; 5000][2];
}