about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-12-26 19:31:52 +0100
committerRalf Jung <post@ralfj.de>2023-12-26 20:15:26 +0100
commit0f9baa8a31a4bf4d38ff90e402d43f0cd19662a8 (patch)
treea3a3ffb54aad685b1a058d7dbca66b8a47400c0f /tests
parente1fadb2c35a6082867a037f012bfdfc5eb686211 (diff)
downloadrust-0f9baa8a31a4bf4d38ff90e402d43f0cd19662a8.tar.gz
rust-0f9baa8a31a4bf4d38ff90e402d43f0cd19662a8.zip
custom mir: make it clear what the return block is
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/building/custom/terminators.rs8
-rw-r--r--tests/mir-opt/building/custom/unwind_action.rs8
-rw-r--r--tests/mir-opt/copy-prop/borrowed_local.rs4
-rw-r--r--tests/mir-opt/copy-prop/calls.rs2
-rw-r--r--tests/mir-opt/copy-prop/custom_move_arg.rs4
-rw-r--r--tests/mir-opt/copy-prop/move_projection.rs4
-rw-r--r--tests/mir-opt/dead-store-elimination/call_arg_copy.rs2
-rw-r--r--tests/mir-opt/dead-store-elimination/cycle.rs4
-rw-r--r--tests/mir-opt/gvn.rs12
-rw-r--r--tests/mir-opt/inline/indirect_destination.rs2
-rw-r--r--tests/mir-opt/reference_prop.rs10
-rw-r--r--tests/ui/mir/ssa_call_ret.rs2
-rw-r--r--tests/ui/mir/validate/critical-edge.rs2
-rw-r--r--tests/ui/mir/validate/noncleanup-cleanup.rs2
14 files changed, 33 insertions, 33 deletions
diff --git a/tests/mir-opt/building/custom/terminators.rs b/tests/mir-opt/building/custom/terminators.rs
index a83a6c07461..01c132cf3e7 100644
--- a/tests/mir-opt/building/custom/terminators.rs
+++ b/tests/mir-opt/building/custom/terminators.rs
@@ -13,7 +13,7 @@ fn ident<T>(t: T) -> T {
 fn direct_call(x: i32) -> i32 {
     mir!(
         {
-            Call(RET = ident(x), retblock, UnwindContinue())
+            Call(RET = ident(x), ReturnTo(retblock), UnwindContinue())
         }
 
         retblock = {
@@ -27,7 +27,7 @@ fn direct_call(x: i32) -> i32 {
 fn indirect_call(x: i32, f: fn(i32) -> i32) -> i32 {
     mir!(
         {
-            Call(RET = f(x), retblock, UnwindContinue())
+            Call(RET = f(x), ReturnTo(retblock), UnwindContinue())
         }
 
         retblock = {
@@ -49,7 +49,7 @@ impl<'a> Drop for WriteOnDrop<'a> {
 fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) {
     mir!(
         {
-            Drop(a, retblock, UnwindContinue())
+            Drop(a, ReturnTo(retblock), UnwindContinue())
         }
 
         retblock = {
@@ -64,7 +64,7 @@ fn drop_first<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) {
 fn drop_second<'a>(a: WriteOnDrop<'a>, b: WriteOnDrop<'a>) {
     mir!(
         {
-            Drop(b, retblock, UnwindContinue())
+            Drop(b, ReturnTo(retblock), UnwindContinue())
         }
 
         retblock = {
diff --git a/tests/mir-opt/building/custom/unwind_action.rs b/tests/mir-opt/building/custom/unwind_action.rs
index e3c4ffac358..0dfbf780f67 100644
--- a/tests/mir-opt/building/custom/unwind_action.rs
+++ b/tests/mir-opt/building/custom/unwind_action.rs
@@ -11,7 +11,7 @@ use core::intrinsics::mir::*;
 pub fn a() {
     mir!(
         {
-            Call(RET = a(), bb1, UnwindUnreachable())
+            Call(RET = a(), ReturnTo(bb1), UnwindUnreachable())
         }
         bb1 = {
             Return()
@@ -26,7 +26,7 @@ pub fn a() {
 pub fn b() {
     mir!(
         {
-            Call(RET = b(), bb1, UnwindContinue())
+            Call(RET = b(), ReturnTo(bb1), UnwindContinue())
         }
         bb1 = {
             Return()
@@ -41,7 +41,7 @@ pub fn b() {
 pub fn c() {
     mir!(
         {
-            Call(RET = c(), bb1, UnwindTerminate(ReasonAbi))
+            Call(RET = c(), ReturnTo(bb1), UnwindTerminate(ReasonAbi))
         }
         bb1 = {
             Return()
@@ -56,7 +56,7 @@ pub fn c() {
 pub fn d() {
     mir!(
         {
-            Call(RET = d(), bb1, UnwindCleanup(bb2))
+            Call(RET = d(), ReturnTo(bb1), UnwindCleanup(bb2))
         }
         bb1 = {
             Return()
diff --git a/tests/mir-opt/copy-prop/borrowed_local.rs b/tests/mir-opt/copy-prop/borrowed_local.rs
index a44e65164af..af40f5bce8b 100644
--- a/tests/mir-opt/copy-prop/borrowed_local.rs
+++ b/tests/mir-opt/copy-prop/borrowed_local.rs
@@ -22,11 +22,11 @@ fn f() -> bool {
             let b = a;
             // We cannot propagate the place `a`.
             let r2 = &b;
-            Call(RET = cmp_ref(r1, r2), next, UnwindContinue())
+            Call(RET = cmp_ref(r1, r2), ReturnTo(next), UnwindContinue())
         }
         next = {
             // But we can propagate the value `a`.
-            Call(RET = opaque(b), ret, UnwindContinue())
+            Call(RET = opaque(b), ReturnTo(ret), UnwindContinue())
         }
         ret = {
             Return()
diff --git a/tests/mir-opt/copy-prop/calls.rs b/tests/mir-opt/copy-prop/calls.rs
index bc6760707cc..a6b5d511805 100644
--- a/tests/mir-opt/copy-prop/calls.rs
+++ b/tests/mir-opt/copy-prop/calls.rs
@@ -26,7 +26,7 @@ fn multiple_edges(t: bool) -> u8 {
             match t { true => bbt, _ => ret }
         }
         bbt = {
-            Call(x = dummy(13), ret, UnwindContinue())
+            Call(x = dummy(13), ReturnTo(ret), UnwindContinue())
         }
         ret = {
             // `x` is not assigned on the `bb0 -> ret` edge,
diff --git a/tests/mir-opt/copy-prop/custom_move_arg.rs b/tests/mir-opt/copy-prop/custom_move_arg.rs
index 8593d9fa9ab..45913626a8f 100644
--- a/tests/mir-opt/copy-prop/custom_move_arg.rs
+++ b/tests/mir-opt/copy-prop/custom_move_arg.rs
@@ -14,11 +14,11 @@ struct NotCopy(bool);
 fn f(_1: NotCopy) {
     mir!({
         let _2 = _1;
-        Call(RET = opaque(Move(_1)), bb1, UnwindContinue())
+        Call(RET = opaque(Move(_1)), ReturnTo(bb1), UnwindContinue())
     }
     bb1 = {
         let _3 = Move(_2);
-        Call(RET = opaque(_3), bb2, UnwindContinue())
+        Call(RET = opaque(_3), ReturnTo(bb2), UnwindContinue())
     }
     bb2 = {
         Return()
diff --git a/tests/mir-opt/copy-prop/move_projection.rs b/tests/mir-opt/copy-prop/move_projection.rs
index 438a90dddd0..f02867814ac 100644
--- a/tests/mir-opt/copy-prop/move_projection.rs
+++ b/tests/mir-opt/copy-prop/move_projection.rs
@@ -18,10 +18,10 @@ fn f(a: Foo) -> bool {
             let b = a;
             // This is a move out of a copy, so must become a copy of `a.0`.
             let c = Move(b.0);
-            Call(RET = opaque(Move(a)), bb1, UnwindContinue())
+            Call(RET = opaque(Move(a)), ReturnTo(bb1), UnwindContinue())
         }
         bb1 = {
-            Call(RET = opaque(Move(c)), ret, UnwindContinue())
+            Call(RET = opaque(Move(c)), ReturnTo(ret), UnwindContinue())
         }
         ret = {
             Return()
diff --git a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs
index b2eb64756f9..490a4aa502c 100644
--- a/tests/mir-opt/dead-store-elimination/call_arg_copy.rs
+++ b/tests/mir-opt/dead-store-elimination/call_arg_copy.rs
@@ -28,7 +28,7 @@ struct Packed {
 fn move_packed(packed: Packed) {
     mir!(
         {
-            Call(RET = use_both(0, packed.y), ret, UnwindContinue())
+            Call(RET = use_both(0, packed.y), ReturnTo(ret), UnwindContinue())
         }
         ret = {
             Return()
diff --git a/tests/mir-opt/dead-store-elimination/cycle.rs b/tests/mir-opt/dead-store-elimination/cycle.rs
index c9ad06a9da2..13e5411275d 100644
--- a/tests/mir-opt/dead-store-elimination/cycle.rs
+++ b/tests/mir-opt/dead-store-elimination/cycle.rs
@@ -20,7 +20,7 @@ fn cycle(mut x: i32, mut y: i32, mut z: i32) {
     mir!(
         let condition: bool;
         {
-            Call(condition = cond(), bb1, UnwindContinue())
+            Call(condition = cond(), ReturnTo(bb1), UnwindContinue())
         }
         bb1 = {
             match condition { true => bb2, _ => ret }
@@ -30,7 +30,7 @@ fn cycle(mut x: i32, mut y: i32, mut z: i32) {
             z = y;
             y = x;
             x = temp;
-            Call(condition = cond(), bb1, UnwindContinue())
+            Call(condition = cond(), ReturnTo(bb1), UnwindContinue())
         }
         ret = {
             Return()
diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs
index db131f7f97d..23e33a0fa49 100644
--- a/tests/mir-opt/gvn.rs
+++ b/tests/mir-opt/gvn.rs
@@ -529,31 +529,31 @@ fn duplicate_slice() -> (bool, bool) {
             // CHECK: [[a:_.*]] = (const "a",);
             // CHECK: [[au:_.*]] = ([[a]].0: &str) as u128 (Transmute);
             let a = ("a",);
-            Call(au = transmute::<_, u128>(a.0), bb1, UnwindContinue())
+            Call(au = transmute::<_, u128>(a.0), ReturnTo(bb1), UnwindContinue())
         }
         bb1 = {
             // CHECK: [[c:_.*]] = identity::<&str>(([[a]].0: &str))
-            Call(c = identity(a.0), bb2, UnwindContinue())
+            Call(c = identity(a.0), ReturnTo(bb2), UnwindContinue())
         }
         bb2 = {
             // CHECK: [[cu:_.*]] = [[c]] as u128 (Transmute);
-            Call(cu = transmute::<_, u128>(c), bb3, UnwindContinue())
+            Call(cu = transmute::<_, u128>(c), ReturnTo(bb3), UnwindContinue())
         }
         bb3 = {
             // This slice is different from `a.0`. Hence `bu` is not `au`.
             // CHECK: [[b:_.*]] = const "a";
             // CHECK: [[bu:_.*]] = [[b]] as u128 (Transmute);
             let b = "a";
-            Call(bu = transmute::<_, u128>(b), bb4, UnwindContinue())
+            Call(bu = transmute::<_, u128>(b), ReturnTo(bb4), UnwindContinue())
         }
         bb4 = {
             // This returns a copy of `b`, which is not `a`.
             // CHECK: [[d:_.*]] = identity::<&str>([[b]])
-            Call(d = identity(b), bb5, UnwindContinue())
+            Call(d = identity(b), ReturnTo(bb5), UnwindContinue())
         }
         bb5 = {
             // CHECK: [[du:_.*]] = [[d]] as u128 (Transmute);
-            Call(du = transmute::<_, u128>(d), bb6, UnwindContinue())
+            Call(du = transmute::<_, u128>(d), ReturnTo(bb6), UnwindContinue())
         }
         bb6 = {
             // `direct` must not fold to `true`, as `indirect` will not.
diff --git a/tests/mir-opt/inline/indirect_destination.rs b/tests/mir-opt/inline/indirect_destination.rs
index 2842e23366e..82143d85c25 100644
--- a/tests/mir-opt/inline/indirect_destination.rs
+++ b/tests/mir-opt/inline/indirect_destination.rs
@@ -25,7 +25,7 @@ pub fn f(a: *mut u8) {
             Goto(bb1)
         }
         bb1 = {
-            Call(*a = g(), bb1, UnwindUnreachable())
+            Call(*a = g(), ReturnTo(bb1), UnwindUnreachable())
         }
     }
 }
diff --git a/tests/mir-opt/reference_prop.rs b/tests/mir-opt/reference_prop.rs
index 8adfbb4535b..b71ad90abb1 100644
--- a/tests/mir-opt/reference_prop.rs
+++ b/tests/mir-opt/reference_prop.rs
@@ -696,7 +696,7 @@ fn multiple_storage() {
             // As there are multiple `StorageLive` statements for `x`, we cannot know if this `z`'s
             // pointer address is the address of `x`, so do nothing.
             let y = *z;
-            Call(RET = opaque(y), retblock, UnwindContinue())
+            Call(RET = opaque(y), ReturnTo(retblock), UnwindContinue())
         }
 
         retblock = {
@@ -724,7 +724,7 @@ fn dominate_storage() {
         }
         bb1 = {
             let c = *r;
-            Call(RET = opaque(c), bb2, UnwindContinue())
+            Call(RET = opaque(c), ReturnTo(bb2), UnwindContinue())
         }
         bb2 = {
             StorageDead(x);
@@ -760,18 +760,18 @@ fn maybe_dead(m: bool) {
         bb1 = {
             StorageDead(x);
             StorageDead(y);
-            Call(RET = opaque(u), bb2, UnwindContinue())
+            Call(RET = opaque(u), ReturnTo(bb2), UnwindContinue())
         }
         bb2 = {
             // As `x` may be `StorageDead`, `a` may be dangling, so we do nothing.
             let z = *a;
-            Call(RET = opaque(z), bb3, UnwindContinue())
+            Call(RET = opaque(z), ReturnTo(bb3), UnwindContinue())
         }
         bb3 = {
             // As `y` may be `StorageDead`, `b` may be dangling, so we do nothing.
             // This implies that we also do not substitute `b` in `bb0`.
             let t = *b;
-            Call(RET = opaque(t), retblock, UnwindContinue())
+            Call(RET = opaque(t), ReturnTo(retblock), UnwindContinue())
         }
         retblock = {
             Return()
diff --git a/tests/ui/mir/ssa_call_ret.rs b/tests/ui/mir/ssa_call_ret.rs
index 6132a6691de..f8a83249225 100644
--- a/tests/ui/mir/ssa_call_ret.rs
+++ b/tests/ui/mir/ssa_call_ret.rs
@@ -13,7 +13,7 @@ pub fn f() -> u32 {
     mir!(
         let a: u32;
         {
-            Call(a = g(), bb1, UnwindCleanup(bb2))
+            Call(a = g(), ReturnTo(bb1), UnwindCleanup(bb2))
         }
         bb1 = {
             RET = a;
diff --git a/tests/ui/mir/validate/critical-edge.rs b/tests/ui/mir/validate/critical-edge.rs
index 9ef655cd1bb..3bb732ad3f7 100644
--- a/tests/ui/mir/validate/critical-edge.rs
+++ b/tests/ui/mir/validate/critical-edge.rs
@@ -20,7 +20,7 @@ pub fn f(a: u32) -> u32 {
             }
         }
         bb1 = {
-            Call(RET = f(1), bb2, UnwindTerminate(ReasonAbi))
+            Call(RET = f(1), ReturnTo(bb2), UnwindTerminate(ReasonAbi))
         }
 
         bb2 = {
diff --git a/tests/ui/mir/validate/noncleanup-cleanup.rs b/tests/ui/mir/validate/noncleanup-cleanup.rs
index 0a1c4528aa6..a14ab44257f 100644
--- a/tests/ui/mir/validate/noncleanup-cleanup.rs
+++ b/tests/ui/mir/validate/noncleanup-cleanup.rs
@@ -11,7 +11,7 @@ use core::intrinsics::mir::*;
 pub fn main() {
     mir!(
         {
-            Call(RET = main(), block, UnwindCleanup(block))
+            Call(RET = main(), ReturnTo(block), UnwindCleanup(block))
         }
         block = {
             Return()