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

24 lines
646 B
Rust
Raw Normal View History

2023-04-23 16:15:22 +00: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
2024-01-08 20:20:53 -08:00
// CHECK-LABEL: fn main
2023-04-23 16:15:22 +00:00
fn main() {
2024-01-08 20:20:53 -08:00
// CHECK: debug local => [[local:_[0-9]+]];
// CHECK: debug constant => [[constant:_[0-9]+]];
// CHECK: {{_[0-9]+}} = const 3_usize;
// CHECK: {{_[0-9]+}} = const true;
// CHECK: [[local]] = (*{{_[0-9]+}})[1 of 2];
2023-09-07 15:59:05 +00:00
let local = (&[1u32, 2, 3] as &[u32])[1];
const SLICE: &[u32] = &[1, 2, 3];
2024-01-08 20:20:53 -08:00
// CHECK: [[constant]] = (*{{_[0-9]+}})[1 of 2];
2023-09-07 15:59:05 +00:00
let constant = SLICE[1];
2023-04-23 16:15:22 +00:00
}