FileCheck array_index_is_temporary.rs
This commit is contained in:
parent
8daf14f046
commit
47fa01d2b8
@ -1,4 +1,4 @@
|
||||
// skip-filecheck
|
||||
// unit-test: SimplifyCfg-elaborate-drops
|
||||
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
||||
// Retagging (from Stacked Borrows) relies on the array index being a fresh
|
||||
// temporary, so that side-effects cannot change it.
|
||||
@ -12,6 +12,12 @@ unsafe fn foo(z: *mut usize) -> u32 {
|
||||
|
||||
// EMIT_MIR array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
|
||||
fn main() {
|
||||
// CHECK-LABEL: fn main(
|
||||
// CHECK: debug x => [[x:_.*]];
|
||||
// CHECK: debug y => [[y:_.*]];
|
||||
// CHECK: [[y]] = const 1_usize;
|
||||
// CHECK: [[tmp:_.*]] = [[y]];
|
||||
// CHECK: [[x]][[[tmp]]] =
|
||||
let mut x = [42, 43, 44];
|
||||
let mut y = 1;
|
||||
let z: *mut usize = &mut y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user