about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
diff options
context:
space:
mode:
authorThe Miri Cronjob Bot <miri@cron.bot>2024-06-21 05:14:59 +0000
committerThe Miri Cronjob Bot <miri@cron.bot>2024-06-21 05:14:59 +0000
commit9d7de1fbdbf57b5d21e8a841c306e7d1f228ef37 (patch)
treed62e86b319c4f189d03be09be1a3deb4b46a93fe /tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
parent121b06bd0593369477a70dfee156f10055ca7638 (diff)
parent553a69030e5a086eb3841d020db8c9c463948c72 (diff)
Merge from rustc
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff')
-rw-r--r--tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
new file mode 100644
index 00000000000..0299c6acd80
--- /dev/null
+++ b/tests/mir-opt/lower_array_len.array_len_reborrow.GVN.panic-unwind.diff
@@ -0,0 +1,46 @@
+- // MIR for `array_len_reborrow` before GVN
++ // MIR for `array_len_reborrow` after GVN
+  
+  fn array_len_reborrow(_1: [u8; N]) -> usize {
+      debug arr => _1;
+      let mut _0: usize;
+      let _2: &mut [u8];
+      let mut _3: &mut [u8; N];
+      let mut _4: &mut [u8; N];
+      let mut _6: &[u8];
+      scope 1 {
+          debug arr => _2;
+          let _5: &[u8];
+          scope 2 {
+              debug arr => _5;
+          }
+      }
+  
+      bb0: {
+-         StorageLive(_2);
++         nop;
+          StorageLive(_3);
+          StorageLive(_4);
+          _4 = &mut _1;
+          _3 = &mut (*_4);
+          _2 = move _3 as &mut [u8] (PointerCoercion(Unsize));
+          StorageDead(_3);
+          StorageDead(_4);
+          StorageLive(_5);
+          _5 = &(*_2);
+          StorageLive(_6);
+          _6 = &(*_5);
+-         _0 = PtrMetadata(move _6);
++         _0 = const N;
+          goto -> bb1;
+      }
+  
+      bb1: {
+          StorageDead(_6);
+          StorageDead(_5);
+-         StorageDead(_2);
++         nop;
+          return;
+      }
+  }
+