FileCheck slice_len.

This commit is contained in:
Camille GILLOT 2023-12-02 21:04:15 +00:00
parent 3e90c1b434
commit 19767eb7a6
5 changed files with 22 additions and 7 deletions

View File

@ -12,6 +12,9 @@
let mut _7: usize;
let mut _8: bool;
let mut _9: &[u32; 3];
scope 1 {
debug a => _1;
}
bb0: {
StorageLive(_1);
@ -39,8 +42,8 @@
StorageDead(_6);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
StorageDead(_1);
return;
}
}

View File

@ -12,6 +12,9 @@
let mut _7: usize;
let mut _8: bool;
let mut _9: &[u32; 3];
scope 1 {
debug a => _1;
}
bb0: {
StorageLive(_1);
@ -39,8 +42,8 @@
StorageDead(_6);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
StorageDead(_1);
return;
}
}

View File

@ -12,6 +12,9 @@
let mut _7: usize;
let mut _8: bool;
let mut _9: &[u32; 3];
scope 1 {
debug a => _1;
}
bb0: {
StorageLive(_1);
@ -39,8 +42,8 @@
StorageDead(_6);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
StorageDead(_1);
return;
}
}

View File

@ -12,6 +12,9 @@
let mut _7: usize;
let mut _8: bool;
let mut _9: &[u32; 3];
scope 1 {
debug a => _1;
}
bb0: {
StorageLive(_1);
@ -39,8 +42,8 @@
StorageDead(_6);
StorageDead(_4);
StorageDead(_2);
StorageDead(_1);
_0 = const ();
StorageDead(_1);
return;
}
}

View File

@ -1,10 +1,13 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Zmir-enable-passes=+InstSimplify
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR slice_len.main.ConstProp.diff
fn main() {
(&[1u32, 2, 3] as &[u32])[1];
// CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK: assert(const true,
// CHECK: [[a]] = const 2_u32;
let a = (&[1u32, 2, 3] as &[u32])[1];
}