summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2024-04-17 18:14:16 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2024-04-18 09:35:36 -0700
commit90b4c86335f625f64e6238614d4c7cfd0dbbb37a (patch)
tree416c7ef4a7886e4d4da85bc084bacc0ba750508a /tests
parent6094063c35d3b3f7c07b6c069ebeb27797ddadc1 (diff)
downloadrust-90b4c86335f625f64e6238614d4c7cfd0dbbb37a.tar.gz
rust-90b4c86335f625f64e6238614d4c7cfd0dbbb37a.zip
Ensure `[rust] debuginfo-level-std` doesn't change core's MIR
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff1
-rw-r--r--tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff1
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir6
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir6
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir79
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir79
6 files changed, 16 insertions, 156 deletions
diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff
index fcfa5953fc2..859082c3111 100644
--- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff
+++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-abort.diff
@@ -16,6 +16,7 @@
 +     scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) {
 +         debug pointer => _3;
 +         scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) {
++             debug pointer => _3;
 +         }
 +     }
 +     scope 5 (inlined g::{closure#0}) {
diff --git a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff
index 69c632a9043..44b06c34972 100644
--- a/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff
+++ b/tests/mir-opt/inline/inline_coroutine.main.Inline.panic-unwind.diff
@@ -16,6 +16,7 @@
 +     scope 3 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new) {
 +         debug pointer => _3;
 +         scope 4 (inlined Pin::<&mut {coroutine@$DIR/inline_coroutine.rs:19:5: 19:8}>::new_unchecked) {
++             debug pointer => _3;
 +         }
 +     }
 +     scope 5 (inlined g::{closure#0}) {
diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir
index cadebcdf1f8..845673601b2 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-abort.mir
@@ -13,11 +13,17 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> {
             debug b => _5;
         }
         scope 3 (inlined core::num::<impl u32>::overflowing_shl) {
+            debug self => _1;
+            debug rhs => _2;
             let mut _4: u32;
             let mut _5: bool;
             scope 4 (inlined core::num::<impl u32>::wrapping_shl) {
+                debug self => _1;
+                debug rhs => _2;
                 let mut _3: u32;
                 scope 5 (inlined core::num::<impl u32>::unchecked_shl) {
+                    debug self => _1;
+                    debug rhs => _3;
                 }
             }
         }
diff --git a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir
index cadebcdf1f8..845673601b2 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.checked_shl.PreCodegen.after.panic-unwind.mir
@@ -13,11 +13,17 @@ fn checked_shl(_1: u32, _2: u32) -> Option<u32> {
             debug b => _5;
         }
         scope 3 (inlined core::num::<impl u32>::overflowing_shl) {
+            debug self => _1;
+            debug rhs => _2;
             let mut _4: u32;
             let mut _5: bool;
             scope 4 (inlined core::num::<impl u32>::wrapping_shl) {
+                debug self => _1;
+                debug rhs => _2;
                 let mut _3: u32;
                 scope 5 (inlined core::num::<impl u32>::unchecked_shl) {
+                    debug self => _1;
+                    debug rhs => _3;
                 }
             }
         }
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
index 9ff61d35fc5..cfb9134a1f1 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
@@ -4,89 +4,12 @@ fn step_forward(_1: u16, _2: usize) -> u16 {
     debug x => _1;
     debug n => _2;
     let mut _0: u16;
-    scope 1 (inlined <u16 as Step>::forward) {
-        debug start => _1;
-        debug n => _2;
-        let mut _8: u16;
-        scope 2 {
-        }
-        scope 3 (inlined <u16 as Step>::forward_checked) {
-            scope 4 {
-                scope 6 (inlined core::num::<impl u16>::checked_add) {
-                    let mut _7: bool;
-                    scope 7 {
-                    }
-                    scope 8 (inlined core::num::<impl u16>::overflowing_add) {
-                        let mut _5: (u16, bool);
-                        let _6: bool;
-                        scope 9 {
-                        }
-                    }
-                }
-            }
-            scope 5 (inlined convert::num::ptr_try_from_impls::<impl TryFrom<usize> for u16>::try_from) {
-                let mut _3: bool;
-                let mut _4: u16;
-            }
-        }
-        scope 10 (inlined Option::<u16>::is_none) {
-            scope 11 (inlined Option::<u16>::is_some) {
-            }
-        }
-        scope 12 (inlined core::num::<impl u16>::wrapping_add) {
-        }
-    }
 
     bb0: {
-        StorageLive(_4);
-        StorageLive(_3);
-        _3 = Gt(_2, const 65535_usize);
-        switchInt(move _3) -> [0: bb1, otherwise: bb5];
+        _0 = <u16 as Step>::forward(move _1, move _2) -> [return: bb1, unwind unreachable];
     }
 
     bb1: {
-        _4 = _2 as u16 (IntToInt);
-        StorageDead(_3);
-        StorageLive(_6);
-        StorageLive(_5);
-        _5 = CheckedAdd(_1, _4);
-        _6 = (_5.1: bool);
-        StorageDead(_5);
-        StorageLive(_7);
-        _7 = unlikely(move _6) -> [return: bb2, unwind unreachable];
-    }
-
-    bb2: {
-        switchInt(move _7) -> [0: bb3, otherwise: bb4];
-    }
-
-    bb3: {
-        StorageDead(_7);
-        StorageDead(_6);
-        goto -> bb7;
-    }
-
-    bb4: {
-        StorageDead(_7);
-        StorageDead(_6);
-        goto -> bb6;
-    }
-
-    bb5: {
-        StorageDead(_3);
-        goto -> bb6;
-    }
-
-    bb6: {
-        assert(!const true, "attempt to compute `{} + {}`, which would overflow", const core::num::<impl u16>::MAX, const 1_u16) -> [success: bb7, unwind unreachable];
-    }
-
-    bb7: {
-        StorageLive(_8);
-        _8 = _2 as u16 (IntToInt);
-        _0 = Add(_1, _8);
-        StorageDead(_8);
-        StorageDead(_4);
         return;
     }
 }
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
index 36cba172a1a..cacc1224aba 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
@@ -4,89 +4,12 @@ fn step_forward(_1: u16, _2: usize) -> u16 {
     debug x => _1;
     debug n => _2;
     let mut _0: u16;
-    scope 1 (inlined <u16 as Step>::forward) {
-        debug start => _1;
-        debug n => _2;
-        let mut _8: u16;
-        scope 2 {
-        }
-        scope 3 (inlined <u16 as Step>::forward_checked) {
-            scope 4 {
-                scope 6 (inlined core::num::<impl u16>::checked_add) {
-                    let mut _7: bool;
-                    scope 7 {
-                    }
-                    scope 8 (inlined core::num::<impl u16>::overflowing_add) {
-                        let mut _5: (u16, bool);
-                        let _6: bool;
-                        scope 9 {
-                        }
-                    }
-                }
-            }
-            scope 5 (inlined convert::num::ptr_try_from_impls::<impl TryFrom<usize> for u16>::try_from) {
-                let mut _3: bool;
-                let mut _4: u16;
-            }
-        }
-        scope 10 (inlined Option::<u16>::is_none) {
-            scope 11 (inlined Option::<u16>::is_some) {
-            }
-        }
-        scope 12 (inlined core::num::<impl u16>::wrapping_add) {
-        }
-    }
 
     bb0: {
-        StorageLive(_4);
-        StorageLive(_3);
-        _3 = Gt(_2, const 65535_usize);
-        switchInt(move _3) -> [0: bb1, otherwise: bb5];
+        _0 = <u16 as Step>::forward(move _1, move _2) -> [return: bb1, unwind continue];
     }
 
     bb1: {
-        _4 = _2 as u16 (IntToInt);
-        StorageDead(_3);
-        StorageLive(_6);
-        StorageLive(_5);
-        _5 = CheckedAdd(_1, _4);
-        _6 = (_5.1: bool);
-        StorageDead(_5);
-        StorageLive(_7);
-        _7 = unlikely(move _6) -> [return: bb2, unwind unreachable];
-    }
-
-    bb2: {
-        switchInt(move _7) -> [0: bb3, otherwise: bb4];
-    }
-
-    bb3: {
-        StorageDead(_7);
-        StorageDead(_6);
-        goto -> bb7;
-    }
-
-    bb4: {
-        StorageDead(_7);
-        StorageDead(_6);
-        goto -> bb6;
-    }
-
-    bb5: {
-        StorageDead(_3);
-        goto -> bb6;
-    }
-
-    bb6: {
-        assert(!const true, "attempt to compute `{} + {}`, which would overflow", const core::num::<impl u16>::MAX, const 1_u16) -> [success: bb7, unwind continue];
-    }
-
-    bb7: {
-        StorageLive(_8);
-        _8 = _2 as u16 (IntToInt);
-        _0 = Add(_1, _8);
-        StorageDead(_8);
-        StorageDead(_4);
         return;
     }
 }