FileCheck ref_deref.

This commit is contained in:
Camille GILLOT 2023-12-02 20:58:35 +00:00
parent c8c9207e4c
commit 6baec3ccc2
4 changed files with 19 additions and 8 deletions

View File

@ -7,6 +7,9 @@
let mut _2: &i32; let mut _2: &i32;
let _3: i32; let _3: i32;
let mut _4: &i32; let mut _4: &i32;
scope 1 {
debug a => _1;
}
bb0: { bb0: {
StorageLive(_1); StorageLive(_1);
@ -15,8 +18,8 @@
_2 = &(*_4); _2 = &(*_4);
_1 = (*_2); _1 = (*_2);
StorageDead(_2); StorageDead(_2);
StorageDead(_1);
_0 = const (); _0 = const ();
StorageDead(_1);
return; return;
} }
} }

View File

@ -1,7 +1,9 @@
// skip-filecheck
// unit-test: ConstProp // unit-test: ConstProp
// EMIT_MIR ref_deref.main.ConstProp.diff
// EMIT_MIR ref_deref.main.ConstProp.diff
fn main() { fn main() {
*(&4); // CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK: [[a]] = (*{{_.*}});
let a = *(&4);
} }

View File

@ -7,6 +7,9 @@
let mut _2: &i32; let mut _2: &i32;
let _3: (i32, i32); let _3: (i32, i32);
let mut _4: &(i32, i32); let mut _4: &(i32, i32);
scope 1 {
debug a => _1;
}
bb0: { bb0: {
StorageLive(_1); StorageLive(_1);
@ -15,8 +18,8 @@
_2 = &((*_4).1: i32); _2 = &((*_4).1: i32);
_1 = (*_2); _1 = (*_2);
StorageDead(_2); StorageDead(_2);
StorageDead(_1);
_0 = const (); _0 = const ();
StorageDead(_1);
return; return;
} }
} }

View File

@ -1,7 +1,10 @@
// skip-filecheck // This does not currently propagate (#67862)
// unit-test: ConstProp // unit-test: ConstProp
// EMIT_MIR ref_deref_project.main.ConstProp.diff
// EMIT_MIR ref_deref_project.main.ConstProp.diff
fn main() { fn main() {
*(&(4, 5).1); // This does not currently propagate (#67862) // CHECK-LABEL: fn main(
// CHECK: debug a => [[a:_.*]];
// CHECK: [[a]] = (*{{_.*}});
let a = *(&(4, 5).1);
} }