diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-05-16 02:07:31 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2024-05-17 20:33:02 -0700 |
| commit | 95c0e5c6a86ca467b0fb7043bd56dee82418ac5f (patch) | |
| tree | 961ac9359e2a2d7edcf81a1f97a7ef0a5514e096 /tests | |
| parent | 8e78d168040b2d7106a28712c39106602c7a1d61 (diff) | |
| download | rust-95c0e5c6a86ca467b0fb7043bd56dee82418ac5f.tar.gz rust-95c0e5c6a86ca467b0fb7043bd56dee82418ac5f.zip | |
Remove `Rvalue::CheckedBinaryOp`
Diffstat (limited to 'tests')
28 files changed, 47 insertions, 47 deletions
diff --git a/tests/mir-opt/building/custom/operators.f.built.after.mir b/tests/mir-opt/building/custom/operators.f.built.after.mir index 33eb6b720e8..cac82f7b3ea 100644 --- a/tests/mir-opt/building/custom/operators.f.built.after.mir +++ b/tests/mir-opt/building/custom/operators.f.built.after.mir @@ -21,7 +21,7 @@ fn f(_1: i32, _2: bool) -> i32 { _2 = Le(_1, _1); _2 = Ge(_1, _1); _2 = Gt(_1, _1); - _3 = CheckedAdd(_1, _1); + _3 = AddWithOverflow(_1, _1); _2 = (_3.1: bool); _1 = (_3.0: i32); _0 = _1; diff --git a/tests/mir-opt/const_prop/checked_add.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/checked_add.main.GVN.panic-abort.diff index d5117b2f638..0e93c167ebc 100644 --- a/tests/mir-opt/const_prop/checked_add.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/checked_add.main.GVN.panic-abort.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 1_u32, const 1_u32); +- _2 = AddWithOverflow(const 1_u32, const 1_u32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable]; + _2 = const (2_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/checked_add.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/checked_add.main.GVN.panic-unwind.diff index 2118d37672c..589eed5776c 100644 --- a/tests/mir-opt/const_prop/checked_add.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/checked_add.main.GVN.panic-unwind.diff @@ -11,7 +11,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 1_u32, const 1_u32); +- _2 = AddWithOverflow(const 1_u32, const 1_u32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind continue]; + _2 = const (2_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_u32, const 1_u32) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff index 8301a4c1aa8..f24b9755eae 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-abort.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = CheckedAdd(_2, const 1_u8); +- _3 = AddWithOverflow(_2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind unreachable]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff index 8dcbfd2c2c1..44ff313b532 100644 --- a/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/indirect.main.GVN.panic-unwind.diff @@ -14,7 +14,7 @@ StorageLive(_1); StorageLive(_2); - _2 = const 2_u32 as u8 (IntToInt); -- _3 = CheckedAdd(_2, const 1_u8); +- _3 = AddWithOverflow(_2, const 1_u8); - assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> [success: bb1, unwind continue]; + _2 = const 2_u8; + _3 = const (3_u8, false); diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff index 8c5a0df94f4..de9cb7a47a2 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-abort.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = CheckedAdd(_2, _3); +- _4 = AddWithOverflow(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff index 7887a8a9072..1f19a13c1e8 100644 --- a/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/inherit_overflow.main.GVN.panic-unwind.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = CheckedAdd(_2, _3); +- _4 = AddWithOverflow(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/const_prop/return_place.add.GVN.panic-abort.diff b/tests/mir-opt/const_prop/return_place.add.GVN.panic-abort.diff index 51f8227c36b..b2d40daa80c 100644 --- a/tests/mir-opt/const_prop/return_place.add.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/return_place.add.GVN.panic-abort.diff @@ -6,7 +6,7 @@ let mut _1: (u32, bool); bb0: { -- _1 = CheckedAdd(const 2_u32, const 2_u32); +- _1 = AddWithOverflow(const 2_u32, const 2_u32); - assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; + _1 = const (4_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/const_prop/return_place.add.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/return_place.add.GVN.panic-unwind.diff index 8174b4edea6..2eafc51cd3d 100644 --- a/tests/mir-opt/const_prop/return_place.add.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/return_place.add.GVN.panic-unwind.diff @@ -6,7 +6,7 @@ let mut _1: (u32, bool); bb0: { -- _1 = CheckedAdd(const 2_u32, const 2_u32); +- _1 = AddWithOverflow(const 2_u32, const 2_u32); - assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue]; + _1 = const (4_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff index b35538f8972..53663c6476b 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-abort.diff @@ -40,7 +40,7 @@ + _4 = const 1_i32; StorageLive(_5); - _5 = _2; -- _6 = CheckedAdd(_4, _5); +- _6 = AddWithOverflow(_4, _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind unreachable]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -57,7 +57,7 @@ StorageLive(_8); StorageLive(_9); - _9 = _7; -- _10 = CheckedAdd(_9, const 1_i32); +- _10 = AddWithOverflow(_9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind unreachable]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff index 05c96969233..34feb2a6406 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.panic-unwind.diff @@ -40,7 +40,7 @@ + _4 = const 1_i32; StorageLive(_5); - _5 = _2; -- _6 = CheckedAdd(_4, _5); +- _6 = AddWithOverflow(_4, _5); - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> [success: bb1, unwind continue]; + _5 = const 2_i32; + _6 = const (3_i32, false); @@ -57,7 +57,7 @@ StorageLive(_8); StorageLive(_9); - _9 = _7; -- _10 = CheckedAdd(_9, const 1_i32); +- _10 = AddWithOverflow(_9, const 1_i32); - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> [success: bb2, unwind continue]; + _9 = const i32::MAX; + _10 = const (i32::MIN, true); diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff index ca1bd737caf..8d62de0c821 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-abort.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = CheckedAdd(_2, _3); +- _4 = AddWithOverflow(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind unreachable]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff index 0d7fe9360c1..25624851cb3 100644 --- a/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff +++ b/tests/mir-opt/dataflow-const-prop/inherit_overflow.main.DataflowConstProp.panic-unwind.diff @@ -19,7 +19,7 @@ StorageLive(_3); _3 = const 1_u8; StorageLive(_4); -- _4 = CheckedAdd(_2, _3); +- _4 = AddWithOverflow(_2, _3); - assert(!move (_4.1: bool), "attempt to compute `{} + {}`, which would overflow", _2, _3) -> [success: bb1, unwind continue]; + _4 = const (0_u8, true); + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const u8::MAX, const 1_u8) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff index a45d9920a68..5bf22af6ae8 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-abort.diff @@ -31,9 +31,9 @@ StorageLive(_3); StorageLive(_4); _4 = _1; -- _5 = CheckedAdd(_4, const 0_u64); +- _5 = AddWithOverflow(_4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind unreachable]; -+ _5 = CheckedAdd(_1, const 0_u64); ++ _5 = AddWithOverflow(_1, const 0_u64); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind unreachable]; } @@ -52,7 +52,7 @@ StorageLive(_7); StorageLive(_8); _8 = _1; -- _9 = CheckedSub(_8, const 0_u64); +- _9 = SubWithOverflow(_8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind unreachable]; + _9 = _5; + assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind unreachable]; @@ -76,7 +76,7 @@ _12 = _1; StorageLive(_13); _13 = _1; -- _14 = CheckedSub(_12, _13); +- _14 = SubWithOverflow(_12, _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind unreachable]; + _14 = const (0_u64, false); + assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind unreachable]; @@ -99,7 +99,7 @@ StorageLive(_16); StorageLive(_17); _17 = _1; -- _18 = CheckedMul(_17, const 0_u64); +- _18 = MulWithOverflow(_17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind unreachable]; + _18 = const (0_u64, false); + assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind unreachable]; @@ -120,7 +120,7 @@ StorageLive(_20); StorageLive(_21); _21 = _1; -- _22 = CheckedMul(_21, const 1_u64); +- _22 = MulWithOverflow(_21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind unreachable]; + _22 = _5; + assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind unreachable]; diff --git a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff index 9033b392bd4..18d2029e445 100644 --- a/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.arithmetic_checked.GVN.panic-unwind.diff @@ -31,9 +31,9 @@ StorageLive(_3); StorageLive(_4); _4 = _1; -- _5 = CheckedAdd(_4, const 0_u64); +- _5 = AddWithOverflow(_4, const 0_u64); - assert(!move (_5.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, const 0_u64) -> [success: bb1, unwind continue]; -+ _5 = CheckedAdd(_1, const 0_u64); ++ _5 = AddWithOverflow(_1, const 0_u64); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", _1, const 0_u64) -> [success: bb1, unwind continue]; } @@ -52,7 +52,7 @@ StorageLive(_7); StorageLive(_8); _8 = _1; -- _9 = CheckedSub(_8, const 0_u64); +- _9 = SubWithOverflow(_8, const 0_u64); - assert(!move (_9.1: bool), "attempt to compute `{} - {}`, which would overflow", move _8, const 0_u64) -> [success: bb3, unwind continue]; + _9 = _5; + assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, const 0_u64) -> [success: bb3, unwind continue]; @@ -76,7 +76,7 @@ _12 = _1; StorageLive(_13); _13 = _1; -- _14 = CheckedSub(_12, _13); +- _14 = SubWithOverflow(_12, _13); - assert(!move (_14.1: bool), "attempt to compute `{} - {}`, which would overflow", move _12, move _13) -> [success: bb5, unwind continue]; + _14 = const (0_u64, false); + assert(!const false, "attempt to compute `{} - {}`, which would overflow", _1, _1) -> [success: bb5, unwind continue]; @@ -99,7 +99,7 @@ StorageLive(_16); StorageLive(_17); _17 = _1; -- _18 = CheckedMul(_17, const 0_u64); +- _18 = MulWithOverflow(_17, const 0_u64); - assert(!move (_18.1: bool), "attempt to compute `{} * {}`, which would overflow", move _17, const 0_u64) -> [success: bb7, unwind continue]; + _18 = const (0_u64, false); + assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 0_u64) -> [success: bb7, unwind continue]; @@ -120,7 +120,7 @@ StorageLive(_20); StorageLive(_21); _21 = _1; -- _22 = CheckedMul(_21, const 1_u64); +- _22 = MulWithOverflow(_21, const 1_u64); - assert(!move (_22.1: bool), "attempt to compute `{} * {}`, which would overflow", move _21, const 1_u64) -> [success: bb9, unwind continue]; + _22 = _5; + assert(!const false, "attempt to compute `{} * {}`, which would overflow", _1, const 1_u64) -> [success: bb9, unwind continue]; diff --git a/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir index 7dafeabaacc..7d2e97f8d56 100644 --- a/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir +++ b/tests/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir @@ -5,7 +5,7 @@ let mut _1: (usize, bool); bb0: { - _1 = CheckedAdd(const 1_usize, const 1_usize); + _1 = AddWithOverflow(const 1_usize, const 1_usize); assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; } diff --git a/tests/mir-opt/lower_intrinsics.rs b/tests/mir-opt/lower_intrinsics.rs index 12e526ab074..180bfd0a924 100644 --- a/tests/mir-opt/lower_intrinsics.rs +++ b/tests/mir-opt/lower_intrinsics.rs @@ -184,9 +184,9 @@ pub fn assume() { // EMIT_MIR lower_intrinsics.with_overflow.LowerIntrinsics.diff pub fn with_overflow(a: i32, b: i32) { // CHECK-LABEL: fn with_overflow( - // CHECK: CheckedAdd( - // CHECK: CheckedSub( - // CHECK: CheckedMul( + // CHECK: AddWithOverflow( + // CHECK: SubWithOverflow( + // CHECK: MulWithOverflow( let _x = core::intrinsics::add_with_overflow(a, b); let _y = core::intrinsics::sub_with_overflow(a, b); diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff index da84449aaa5..efbbeeeac73 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-abort.diff @@ -31,7 +31,7 @@ StorageLive(_5); _5 = _2; - _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; -+ _3 = CheckedAdd(move _4, move _5); ++ _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; } @@ -44,7 +44,7 @@ StorageLive(_8); _8 = _2; - _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; -+ _6 = CheckedSub(move _7, move _8); ++ _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; } @@ -57,7 +57,7 @@ StorageLive(_11); _11 = _2; - _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; -+ _9 = CheckedMul(move _10, move _11); ++ _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; } diff --git a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff index da84449aaa5..efbbeeeac73 100644 --- a/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.with_overflow.LowerIntrinsics.panic-unwind.diff @@ -31,7 +31,7 @@ StorageLive(_5); _5 = _2; - _3 = add_with_overflow::<i32>(move _4, move _5) -> [return: bb1, unwind unreachable]; -+ _3 = CheckedAdd(move _4, move _5); ++ _3 = AddWithOverflow(move _4, move _5); + goto -> bb1; } @@ -44,7 +44,7 @@ StorageLive(_8); _8 = _2; - _6 = sub_with_overflow::<i32>(move _7, move _8) -> [return: bb2, unwind unreachable]; -+ _6 = CheckedSub(move _7, move _8); ++ _6 = SubWithOverflow(move _7, move _8); + goto -> bb2; } @@ -57,7 +57,7 @@ StorageLive(_11); _11 = _2; - _9 = mul_with_overflow::<i32>(move _10, move _11) -> [return: bb3, unwind unreachable]; -+ _9 = CheckedMul(move _10, move _11); ++ _9 = MulWithOverflow(move _10, move _11); + goto -> bb3; } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff index 0e7e1f971ec..2f34a62b3d1 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-abort.diff @@ -24,7 +24,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 2_i32, const 2_i32); +- _2 = AddWithOverflow(const 2_i32, const 2_i32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; + _2 = const (4_i32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff index 9071a3339c0..da7add371a5 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.32bit.panic-unwind.diff @@ -24,7 +24,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 2_i32, const 2_i32); +- _2 = AddWithOverflow(const 2_i32, const 2_i32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; + _2 = const (4_i32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff index 0e7e1f971ec..2f34a62b3d1 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-abort.diff @@ -24,7 +24,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 2_i32, const 2_i32); +- _2 = AddWithOverflow(const 2_i32, const 2_i32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; + _2 = const (4_i32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff index 9071a3339c0..da7add371a5 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.GVN.64bit.panic-unwind.diff @@ -24,7 +24,7 @@ bb0: { StorageLive(_1); -- _2 = CheckedAdd(const 2_i32, const 2_i32); +- _2 = AddWithOverflow(const 2_i32, const 2_i32); - assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; + _2 = const (4_i32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff index 5f2a096bb1f..802bfbbcdc5 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-abort.diff @@ -26,7 +26,7 @@ bb0: { StorageLive(_1); - _2 = CheckedAdd(const 2_i32, const 2_i32); + _2 = AddWithOverflow(const 2_i32, const 2_i32); assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff index a49546f158c..de94a557403 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.32bit.panic-unwind.diff @@ -26,7 +26,7 @@ bb0: { StorageLive(_1); - _2 = CheckedAdd(const 2_i32, const 2_i32); + _2 = AddWithOverflow(const 2_i32, const 2_i32); assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff index 5f2a096bb1f..802bfbbcdc5 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-abort.diff @@ -26,7 +26,7 @@ bb0: { StorageLive(_1); - _2 = CheckedAdd(const 2_i32, const 2_i32); + _2 = AddWithOverflow(const 2_i32, const 2_i32); assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind unreachable]; } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff index a49546f158c..de94a557403 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.ScalarReplacementOfAggregates.64bit.panic-unwind.diff @@ -26,7 +26,7 @@ bb0: { StorageLive(_1); - _2 = CheckedAdd(const 2_i32, const 2_i32); + _2 = AddWithOverflow(const 2_i32, const 2_i32); assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_i32, const 2_i32) -> [success: bb1, unwind continue]; } diff --git a/tests/run-make/const_fn_mir/dump.mir b/tests/run-make/const_fn_mir/dump.mir index ced170bbeee..b1802c990cf 100644 --- a/tests/run-make/const_fn_mir/dump.mir +++ b/tests/run-make/const_fn_mir/dump.mir @@ -5,7 +5,7 @@ fn foo() -> i32 { let mut _1: (i32, bool); bb0: { - _1 = CheckedAdd(const 5_i32, const 6_i32); + _1 = AddWithOverflow(const 5_i32, const 6_i32); assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue]; } @@ -21,7 +21,7 @@ fn foo() -> i32 { let mut _1: (i32, bool); bb0: { - _1 = CheckedAdd(const 5_i32, const 6_i32); + _1 = AddWithOverflow(const 5_i32, const 6_i32); assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 5_i32, const 6_i32) -> [success: bb1, unwind continue]; } |
