about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-12-02 20:58:35 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-12-02 20:58:45 +0000
commit6baec3ccc27a719e12e5e5ad67995c0cd86f60e6 (patch)
treee51ca830fd77fcfb8cbe880da96e315b578a2ddd
parentc8c9207e4c29a42f69408e92ca95fc34f7bf04c6 (diff)
downloadrust-6baec3ccc27a719e12e5e5ad67995c0cd86f60e6.tar.gz
rust-6baec3ccc27a719e12e5e5ad67995c0cd86f60e6.zip
FileCheck ref_deref.
-rw-r--r--tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff5
-rw-r--r--tests/mir-opt/const_prop/ref_deref.rs8
-rw-r--r--tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff5
-rw-r--r--tests/mir-opt/const_prop/ref_deref_project.rs9
4 files changed, 19 insertions, 8 deletions
diff --git a/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
index 6b897a88181..a54ae8d2fdd 100644
--- a/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/ref_deref.main.ConstProp.diff
@@ -7,6 +7,9 @@
       let mut _2: &i32;
       let _3: i32;
       let mut _4: &i32;
+      scope 1 {
+          debug a => _1;
+      }
   
       bb0: {
           StorageLive(_1);
@@ -15,8 +18,8 @@
           _2 = &(*_4);
           _1 = (*_2);
           StorageDead(_2);
-          StorageDead(_1);
           _0 = const ();
+          StorageDead(_1);
           return;
       }
   }
diff --git a/tests/mir-opt/const_prop/ref_deref.rs b/tests/mir-opt/const_prop/ref_deref.rs
index f2fa024f722..5bceae749ff 100644
--- a/tests/mir-opt/const_prop/ref_deref.rs
+++ b/tests/mir-opt/const_prop/ref_deref.rs
@@ -1,7 +1,9 @@
-// skip-filecheck
 // unit-test: ConstProp
-// EMIT_MIR ref_deref.main.ConstProp.diff
 
+// EMIT_MIR ref_deref.main.ConstProp.diff
 fn main() {
-    *(&4);
+    // CHECK-LABEL: fn main(
+    // CHECK: debug a => [[a:_.*]];
+    // CHECK: [[a]] = (*{{_.*}});
+    let a = *(&4);
 }
diff --git a/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
index 7f616166573..05a4e17742d 100644
--- a/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
+++ b/tests/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
@@ -7,6 +7,9 @@
       let mut _2: &i32;
       let _3: (i32, i32);
       let mut _4: &(i32, i32);
+      scope 1 {
+          debug a => _1;
+      }
   
       bb0: {
           StorageLive(_1);
@@ -15,8 +18,8 @@
           _2 = &((*_4).1: i32);
           _1 = (*_2);
           StorageDead(_2);
-          StorageDead(_1);
           _0 = const ();
+          StorageDead(_1);
           return;
       }
   }
diff --git a/tests/mir-opt/const_prop/ref_deref_project.rs b/tests/mir-opt/const_prop/ref_deref_project.rs
index 1b9e0acb2c0..4b5c6730316 100644
--- a/tests/mir-opt/const_prop/ref_deref_project.rs
+++ b/tests/mir-opt/const_prop/ref_deref_project.rs
@@ -1,7 +1,10 @@
-// skip-filecheck
+// This does not currently propagate (#67862)
 // unit-test: ConstProp
-// EMIT_MIR ref_deref_project.main.ConstProp.diff
 
+// EMIT_MIR ref_deref_project.main.ConstProp.diff
 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);
 }