diff --git a/tests/mir-opt/const_debuginfo.rs b/tests/mir-opt/const_debuginfo.rs index 907d7fef06746..5f1997e79f786 100644 --- a/tests/mir-opt/const_debuginfo.rs +++ b/tests/mir-opt/const_debuginfo.rs @@ -1,5 +1,6 @@ //@ test-mir-pass: SingleUseConsts //@ compile-flags: -C overflow-checks=no -Zmir-enable-passes=+GVN +//@ ignore-endian-big #![allow(unused)] diff --git a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff index 3f4958f60e85b..fc8b4a5a6e8f5 100644 --- a/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff +++ b/tests/mir-opt/const_prop/address_of_pair.fn0.GVN.diff @@ -21,12 +21,12 @@ bb0: { StorageLive(_2); -- _2 = (const 1_i32, const false); -+ _2 = const (1_i32, false); +- _2 = (const 285212689_i32, const false); ++ _2 = const (285212689_i32, false); StorageLive(_3); _3 = &raw mut (_2.1: bool); -- _2 = (const 1_i32, const false); -+ _2 = const (1_i32, false); +- _2 = (const 285212689_i32, const false); ++ _2 = const (285212689_i32, false); StorageLive(_4); (*_3) = const true; _4 = const (); @@ -47,6 +47,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 01 00 00 00 00 __ __ __ │ .....░░░ ++ 11 00 00 11 00 __ __ __ │ .....░░░ } diff --git a/tests/mir-opt/const_prop/address_of_pair.rs b/tests/mir-opt/const_prop/address_of_pair.rs index 6d0c0f8ad52a7..c775e3852b946 100644 --- a/tests/mir-opt/const_prop/address_of_pair.rs +++ b/tests/mir-opt/const_prop/address_of_pair.rs @@ -16,9 +16,9 @@ pub fn fn0() -> bool { // CHECK-NOT: = const false; // CHECK-NOT: = const true; // CHECK: _0 = [[ret]]; - let mut pair = (1, false); + let mut pair = (0x11000011, false); // Endian-invariant value. let ptr = core::ptr::addr_of_mut!(pair.1); - pair = (1, false); + pair = (0x11000011, false); unsafe { *ptr = true; } 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 0e93c167ebc96..94836bd951985 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,15 +11,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_u32, const 285212689_u32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind unreachable]; ++ _2 = const (570425378_u32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind unreachable]; } bb1: { - _1 = move (_2.0: u32); -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; _0 = const (); StorageDead(_1); return; @@ -27,6 +27,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 02 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } 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 589eed5776c9f..614c480ed6baf 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,15 +11,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_u32, const 285212689_u32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind continue]; ++ _2 = const (570425378_u32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind continue]; } bb1: { - _1 = move (_2.0: u32); -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; _0 = const (); StorageDead(_1); return; @@ -27,6 +27,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 02 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } diff --git a/tests/mir-opt/const_prop/checked_add.rs b/tests/mir-opt/const_prop/checked_add.rs index 0560b04957311..8b30c7929e830 100644 --- a/tests/mir-opt/const_prop/checked_add.rs +++ b/tests/mir-opt/const_prop/checked_add.rs @@ -7,6 +7,6 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; // CHECK: assert(!const false, - // CHECK: [[x]] = const 2_u32; - let x: u32 = 1 + 1; + // CHECK: [[x]] = const 570425378_u32; + let x: u32 = 0x11000011 + 0x11000011; // Endian-invariant value. } diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff index b6ff7b0fc234d..fd15c12dbc41f 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.main.GVN.diff @@ -14,8 +14,8 @@ bb0: { StorageLive(_1); -- _1 = (const 42_i32, const 43_i32); -+ _1 = const (42_i32, 43_i32); +- _1 = (const 285212689_i32, const 570425378_i32); ++ _1 = const (285212689_i32, 570425378_i32); (_1.1: i32) = const 99_i32; StorageLive(_2); _2 = _1; @@ -27,6 +27,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 2a 00 00 00 2b 00 00 00 │ *...+... ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs index 7de647ed9c37f..8a599cb56ad05 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate.rs @@ -5,10 +5,10 @@ fn main() { // CHECK-LABEL: fn main( // CHECK: debug x => [[x:_.*]]; // CHECK: debug y => [[y:_.*]]; - // CHECK: [[x]] = const (42_i32, 43_i32); + // CHECK: [[x]] = const (285212689_i32, 570425378_i32); // CHECK: ([[x]].1: i32) = const 99_i32; // CHECK: [[y]] = [[x]]; - let mut x = (42, 43); + let mut x = (0x11000011, 0x22000022); // Endian-invariant values. x.1 = 99; let y = x; } diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff index 4ed7c98514796..16bb6cfe31a21 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.main.GVN.diff @@ -18,8 +18,8 @@ bb0: { StorageLive(_1); -- _1 = (const 42_i32, const 43_i32); -+ _1 = const (42_i32, 43_i32); +- _1 = (const 285212689_i32, const 570425378_i32); ++ _1 = const (285212689_i32, 570425378_i32); StorageLive(_2); _2 = &mut _1; ((*_2).1: i32) = const 99_i32; @@ -34,6 +34,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 2a 00 00 00 2b 00 00 00 │ *...+... ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs index 5656c0e7a6863..e4d7b9595b61d 100644 --- a/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs +++ b/tests/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs @@ -6,11 +6,11 @@ fn main() { // CHECK: debug x => [[x:_.*]]; // CHECK: debug z => [[z:_.*]]; // CHECK: debug y => [[y:_.*]]; - // CHECK: [[x]] = const (42_i32, 43_i32); + // CHECK: [[x]] = const (285212689_i32, 570425378_i32); // CHECK: [[z]] = &mut [[x]]; // CHECK: ((*[[z]]).1: i32) = const 99_i32; // CHECK: [[y]] = [[x]]; - let mut x = (42, 43); + let mut x = (0x11000011, 0x22000022); // Endian-invariant values. let z = &mut x; z.1 = 99; let y = x; diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff index d1d23675bfd91..8d7681fe728bc 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-abort.diff @@ -29,8 +29,8 @@ bb1: { StorageLive(_2); -- _2 = (const 1_i32, const 2_i32); -+ _2 = const (1_i32, 2_i32); +- _2 = (const 285212689_i32, const 570425378_i32); ++ _2 = const (285212689_i32, 570425378_i32); StorageLive(_3); _3 = _1; - (_2.1: i32) = move _3; @@ -51,6 +51,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 01 00 00 00 02 00 00 00 │ ........ ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff index 4d69c9ce2efe6..9622416d91c77 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.main.GVN.panic-unwind.diff @@ -29,8 +29,8 @@ bb1: { StorageLive(_2); -- _2 = (const 1_i32, const 2_i32); -+ _2 = const (1_i32, 2_i32); +- _2 = (const 285212689_i32, const 570425378_i32); ++ _2 = const (285212689_i32, 570425378_i32); StorageLive(_3); _3 = _1; - (_2.1: i32) = move _3; @@ -51,6 +51,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 01 00 00 00 02 00 00 00 │ ........ ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs index cc92949128f72..7777139533201 100644 --- a/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs +++ b/tests/mir-opt/const_prop/mutable_variable_unprop_assign.rs @@ -9,12 +9,12 @@ fn main() { // CHECK: debug y => [[y:_.*]]; // CHECK: debug z => [[z:_.*]]; // CHECK: [[a]] = foo() - // CHECK: [[x]] = const (1_i32, 2_i32); + // CHECK: [[x]] = const (285212689_i32, 570425378_i32); // CHECK: ([[x]].1: i32) = [[a]]; // CHECK: [[y]] = ([[x]].1: i32); // CHECK: [[z]] = ([[x]].0: i32); let a = foo(); - let mut x: (i32, i32) = (1, 2); + let mut x: (i32, i32) = (0x11000011, 0x22000022); // Endian-invariant values. x.1 = a; let y = x.1; let z = x.0; 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 b2d40daa80c4c..678e278d9e31f 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,20 +6,20 @@ let mut _1: (u32, bool); bb0: { -- _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]; +- _1 = AddWithOverflow(const 285212689_u32, const 285212689_u32); +- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind unreachable]; ++ _1 = const (570425378_u32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind unreachable]; } bb1: { - _0 = move (_1.0: u32); -+ _0 = const 4_u32; ++ _0 = const 570425378_u32; return; } + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } 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 2eafc51cd3db6..a9de5fa0983e2 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,20 +6,20 @@ let mut _1: (u32, bool); bb0: { -- _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]; +- _1 = AddWithOverflow(const 285212689_u32, const 285212689_u32); +- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind continue]; ++ _1 = const (570425378_u32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind continue]; } bb1: { - _0 = move (_1.0: u32); -+ _0 = const 4_u32; ++ _0 = const 570425378_u32; return; } + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } diff --git a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir index f87c26bb004c6..9997d6a62facb 100644 --- a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir +++ b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-abort.mir @@ -5,16 +5,16 @@ fn add() -> u32 { let mut _1: (u32, bool); bb0: { - _1 = const (4_u32, false); - assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind unreachable]; + _1 = const (570425378_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind unreachable]; } bb1: { - _0 = const 4_u32; + _0 = const 570425378_u32; return; } } ALLOC0 (size: 8, align: 4) { - 04 00 00 00 00 __ __ __ │ .....░░░ + 22 00 00 22 00 __ __ __ │ "..".░░░ } diff --git a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir index 33f97591387c3..fc42336bdf93b 100644 --- a/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir +++ b/tests/mir-opt/const_prop/return_place.add.PreCodegen.before.panic-unwind.mir @@ -5,16 +5,16 @@ fn add() -> u32 { let mut _1: (u32, bool); bb0: { - _1 = const (4_u32, false); - assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> [success: bb1, unwind continue]; + _1 = const (570425378_u32, false); + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_u32, const 285212689_u32) -> [success: bb1, unwind continue]; } bb1: { - _0 = const 4_u32; + _0 = const 570425378_u32; return; } } ALLOC0 (size: 8, align: 4) { - 04 00 00 00 00 __ __ __ │ .....░░░ + 22 00 00 22 00 __ __ __ │ "..".░░░ } diff --git a/tests/mir-opt/const_prop/return_place.rs b/tests/mir-opt/const_prop/return_place.rs index e7eea11ae492f..6a4a2c8fcd494 100644 --- a/tests/mir-opt/const_prop/return_place.rs +++ b/tests/mir-opt/const_prop/return_place.rs @@ -6,8 +6,8 @@ // EMIT_MIR return_place.add.PreCodegen.before.mir fn add() -> u32 { // CHECK-LABEL: fn add( - // CHECK: _0 = const 4_u32; - 2 + 2 + // CHECK: _0 = const 570425378_u32; + 0x11000011 + 0x11000011 // Endian-invariant value. } fn main() { diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff index ef298dddd5a49..9522af8fbd434 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-abort.diff @@ -41,7 +41,7 @@ bb1: { - _1 = (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -52,6 +52,6 @@ + } + + ALLOC0 (size: 12, align: 4) { -+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............ ++ 11 00 00 11 22 00 00 22 33 00 00 33 │ ....".."3..3 } diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff index 5379df3f60b44..0a0000fa6e3ed 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.32bit.panic-unwind.diff @@ -41,7 +41,7 @@ bb1: { - _1 = (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -52,6 +52,6 @@ + } + + ALLOC0 (size: 12, align: 4) { -+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............ ++ 11 00 00 11 22 00 00 22 33 00 00 33 │ ....".."3..3 } diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff index ef298dddd5a49..9522af8fbd434 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-abort.diff @@ -41,7 +41,7 @@ bb1: { - _1 = (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -52,6 +52,6 @@ + } + + ALLOC0 (size: 12, align: 4) { -+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............ ++ 11 00 00 11 22 00 00 22 33 00 00 33 │ ....".."3..3 } diff --git a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff index 5379df3f60b44..0a0000fa6e3ed 100644 --- a/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff +++ b/tests/mir-opt/const_prop/slice_len.main.GVN.64bit.panic-unwind.diff @@ -41,7 +41,7 @@ bb1: { - _1 = (*_2)[_6]; -+ _1 = const 2_u32; ++ _1 = const 570425378_u32; StorageDead(_6); StorageDead(_4); StorageDead(_2); @@ -52,6 +52,6 @@ + } + + ALLOC0 (size: 12, align: 4) { -+ 01 00 00 00 02 00 00 00 03 00 00 00 │ ............ ++ 11 00 00 11 22 00 00 22 33 00 00 33 │ ....".."3..3 } diff --git a/tests/mir-opt/const_prop/slice_len.rs b/tests/mir-opt/const_prop/slice_len.rs index 63cdbf01b3e82..fde31fbecb2cf 100644 --- a/tests/mir-opt/const_prop/slice_len.rs +++ b/tests/mir-opt/const_prop/slice_len.rs @@ -9,6 +9,6 @@ fn main() { // CHECK: debug a => [[a:_.*]]; // CHECK: [[slice:_.*]] = const {{.*}} as &[u32] (PointerCoercion(Unsize)); // CHECK: assert(const true, - // CHECK: [[a]] = const 2_u32; - let a = (&[1u32, 2, 3] as &[u32])[1]; + // CHECK: [[a]] = const 570425378_u32; + let a = (&[0x11000011u32, 0x22000022, 0x33000033] as &[u32])[1]; // Endian-invariant values. } diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff index c2f3fb1b3b575..911317869b74d 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-abort.diff @@ -12,15 +12,15 @@ bb0: { - StorageLive(_1); -- _1 = (const 1_u32, const 2_u32); +- _1 = (const 285212689_u32, const 570425378_u32); + nop; -+ _1 = const (1_u32, 2_u32); ++ _1 = const (285212689_u32, 570425378_u32); StorageLive(_2); StorageLive(_3); - _3 = _1; - _2 = consume(move _3) -> [return: bb1, unwind unreachable]; -+ _3 = const (1_u32, 2_u32); -+ _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind unreachable]; ++ _3 = const (285212689_u32, 570425378_u32); ++ _2 = consume(const (285212689_u32, 570425378_u32)) -> [return: bb1, unwind unreachable]; } bb1: { @@ -34,6 +34,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 01 00 00 00 02 00 00 00 │ ........ ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff index 55d9a3b0cac67..e8979e18713d3 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.main.GVN.panic-unwind.diff @@ -12,15 +12,15 @@ bb0: { - StorageLive(_1); -- _1 = (const 1_u32, const 2_u32); +- _1 = (const 285212689_u32, const 570425378_u32); + nop; -+ _1 = const (1_u32, 2_u32); ++ _1 = const (285212689_u32, 570425378_u32); StorageLive(_2); StorageLive(_3); - _3 = _1; - _2 = consume(move _3) -> [return: bb1, unwind continue]; -+ _3 = const (1_u32, 2_u32); -+ _2 = consume(const (1_u32, 2_u32)) -> [return: bb1, unwind continue]; ++ _3 = const (285212689_u32, 570425378_u32); ++ _2 = consume(const (285212689_u32, 570425378_u32)) -> [return: bb1, unwind continue]; } bb1: { @@ -34,6 +34,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 01 00 00 00 02 00 00 00 │ ........ ++ 11 00 00 11 22 00 00 22 │ ....".." } diff --git a/tests/mir-opt/const_prop/tuple_literal_propagation.rs b/tests/mir-opt/const_prop/tuple_literal_propagation.rs index e42a62cb6fdf3..41cf1b2b1bc53 100644 --- a/tests/mir-opt/const_prop/tuple_literal_propagation.rs +++ b/tests/mir-opt/const_prop/tuple_literal_propagation.rs @@ -4,8 +4,8 @@ fn main() { // CHECK-LABEL: fn main( - // CHECK: = consume(const (1_u32, 2_u32)) - let x = (1, 2); + // CHECK: = consume(const (285212689_u32, 570425378_u32)) + let x = (0x11000011, 0x22000022); // Endian-invariant values. consume(x); } diff --git a/tests/mir-opt/dataflow-const-prop/checked.rs b/tests/mir-opt/dataflow-const-prop/checked.rs index a73693464f95b..9f7e6df3d90e0 100644 --- a/tests/mir-opt/dataflow-const-prop/checked.rs +++ b/tests/mir-opt/dataflow-const-prop/checked.rs @@ -1,5 +1,6 @@ //@ test-mir-pass: DataflowConstProp //@ compile-flags: -Coverflow-checks=on +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_PANIC_STRATEGY // EMIT_MIR checked.main.DataflowConstProp.diff diff --git a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs index 3a0cbac328cb5..9ae1a852b7061 100644 --- a/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs +++ b/tests/mir-opt/dataflow-const-prop/default_boxed_slice.rs @@ -1,5 +1,6 @@ //@ test-mir-pass: DataflowConstProp //@ compile-flags: -Zmir-enable-passes=+GVN,+Inline +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR_FOR_EACH_PANIC_STRATEGY diff --git a/tests/mir-opt/dataflow-const-prop/enum.rs b/tests/mir-opt/dataflow-const-prop/enum.rs index 946cfa4c76c02..8dfff5bad9730 100644 --- a/tests/mir-opt/dataflow-const-prop/enum.rs +++ b/tests/mir-opt/dataflow-const-prop/enum.rs @@ -1,4 +1,5 @@ //@ test-mir-pass: DataflowConstProp +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH #![feature(custom_mir, core_intrinsics, rustc_attrs)] diff --git a/tests/mir-opt/dataflow-const-prop/struct.rs b/tests/mir-opt/dataflow-const-prop/struct.rs index eed782c9036b2..50f7e2c2a2969 100644 --- a/tests/mir-opt/dataflow-const-prop/struct.rs +++ b/tests/mir-opt/dataflow-const-prop/struct.rs @@ -1,4 +1,5 @@ //@ test-mir-pass: DataflowConstProp +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH #[derive(Copy, Clone)] diff --git a/tests/mir-opt/dataflow-const-prop/tuple.rs b/tests/mir-opt/dataflow-const-prop/tuple.rs index d624e21f21ac4..9b7ff73670438 100644 --- a/tests/mir-opt/dataflow-const-prop/tuple.rs +++ b/tests/mir-opt/dataflow-const-prop/tuple.rs @@ -1,4 +1,5 @@ //@ test-mir-pass: DataflowConstProp +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH // EMIT_MIR tuple.main.DataflowConstProp.diff diff --git a/tests/mir-opt/enum_opt.rs b/tests/mir-opt/enum_opt.rs index 2cc5df84d6b59..2d01698bf92fb 100644 --- a/tests/mir-opt/enum_opt.rs +++ b/tests/mir-opt/enum_opt.rs @@ -1,5 +1,6 @@ // skip-filecheck //@ test-mir-pass: EnumSizeOpt +//@ ignore-endian-big // EMIT_MIR_FOR_EACH_BIT_WIDTH //@ compile-flags: -Zunsound-mir-opts diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff index 0c49e706c9ecf..b5c0cee784688 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-abort.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; + let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; +- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); - _9 = _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); @@ -88,8 +88,8 @@ StorageLive(_13); - _13 = _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); diff --git a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff index e5f865b74b9f4..7bc6573c13d4d 100644 --- a/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff +++ b/tests/mir-opt/gvn.fn_pointers.GVN.panic-unwind.diff @@ -8,10 +8,10 @@ let mut _3: fn(u8) -> u8; let _5: (); let mut _6: fn(u8) -> u8; - let mut _9: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _9: {closure@$DIR/gvn.rs:615:19: 615:21}; let _10: (); let mut _11: fn(); - let mut _13: {closure@$DIR/gvn.rs:614:19: 614:21}; + let mut _13: {closure@$DIR/gvn.rs:615:19: 615:21}; let _14: (); let mut _15: fn(); scope 1 { @@ -19,7 +19,7 @@ let _4: fn(u8) -> u8; scope 2 { debug g => _4; - let _7: {closure@$DIR/gvn.rs:614:19: 614:21}; + let _7: {closure@$DIR/gvn.rs:615:19: 615:21}; scope 3 { debug closure => _7; let _8: fn(); @@ -62,16 +62,16 @@ StorageDead(_6); StorageDead(_5); - StorageLive(_7); -- _7 = {closure@$DIR/gvn.rs:614:19: 614:21}; +- _7 = {closure@$DIR/gvn.rs:615:19: 615:21}; - StorageLive(_8); + nop; -+ _7 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; ++ _7 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; + nop; StorageLive(_9); - _9 = _7; - _8 = move _9 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _9 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _8 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _9 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _8 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_9); StorageLive(_10); StorageLive(_11); @@ -88,8 +88,8 @@ StorageLive(_13); - _13 = _7; - _12 = move _13 as fn() (PointerCoercion(ClosureFnPointer(Safe))); -+ _13 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21}; -+ _12 = const ZeroSized: {closure@$DIR/gvn.rs:614:19: 614:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); ++ _13 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21}; ++ _12 = const ZeroSized: {closure@$DIR/gvn.rs:615:19: 615:21} as fn() (PointerCoercion(ClosureFnPointer(Safe))); StorageDead(_13); StorageLive(_14); StorageLive(_15); diff --git a/tests/mir-opt/gvn.rs b/tests/mir-opt/gvn.rs index c7fae0bd08108..620c0de3c157d 100644 --- a/tests/mir-opt/gvn.rs +++ b/tests/mir-opt/gvn.rs @@ -1,6 +1,7 @@ //@ test-mir-pass: GVN // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ only-64bit +//@ ignore-endian-big #![feature(raw_ref_op)] #![feature(rustc_attrs)] 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 2f34a62b3d136..fe3672cefef7f 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,15 +24,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_i32, const 285212689_i32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; ++ _2 = const (570425378_i32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; } bb1: { - _1 = move (_2.0: i32); -+ _1 = const 4_i32; ++ _1 = const 570425378_i32; StorageLive(_3); StorageLive(_4); _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; @@ -64,6 +64,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } 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 da7add371a5bf..23ec65751783e 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,15 +24,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_i32, const 285212689_i32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; ++ _2 = const (570425378_i32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; } bb1: { - _1 = move (_2.0: i32); -+ _1 = const 4_i32; ++ _1 = const 570425378_i32; StorageLive(_3); StorageLive(_4); _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; @@ -64,6 +64,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } 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 2f34a62b3d136..fe3672cefef7f 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,15 +24,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_i32, const 285212689_i32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; ++ _2 = const (570425378_i32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; } bb1: { - _1 = move (_2.0: i32); -+ _1 = const 4_i32; ++ _1 = const 570425378_i32; StorageLive(_3); StorageLive(_4); _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; @@ -64,6 +64,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } 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 da7add371a5bf..23ec65751783e 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,15 +24,15 @@ bb0: { StorageLive(_1); -- _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]; +- _2 = AddWithOverflow(const 285212689_i32, const 285212689_i32); +- assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; ++ _2 = const (570425378_i32, false); ++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; } bb1: { - _1 = move (_2.0: i32); -+ _1 = const 4_i32; ++ _1 = const 570425378_i32; StorageLive(_3); StorageLive(_4); _4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; @@ -64,6 +64,6 @@ + } + + ALLOC0 (size: 8, align: 4) { -+ 04 00 00 00 00 __ __ __ │ .....░░░ ++ 22 00 00 22 00 __ __ __ │ "..".░░░ } diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir index 681dadff302b9..dca07cd500e4d 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-abort.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir index 681dadff302b9..dca07cd500e4d 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.32bit.panic-unwind.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir index 681dadff302b9..dca07cd500e4d 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-abort.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir index 681dadff302b9..dca07cd500e4d 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.PreCodegen.after.64bit.panic-unwind.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { 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 802bfbbcdc5fa..072580927e888 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,8 +26,8 @@ bb0: { StorageLive(_1); - _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 = AddWithOverflow(const 285212689_i32, const 285212689_i32); + assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; } bb1: { 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 de94a55740318..eb63a76888de5 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,8 +26,8 @@ bb0: { StorageLive(_1); - _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 = AddWithOverflow(const 285212689_i32, const 285212689_i32); + assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; } bb1: { 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 802bfbbcdc5fa..072580927e888 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,8 +26,8 @@ bb0: { StorageLive(_1); - _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 = AddWithOverflow(const 285212689_i32, const 285212689_i32); + assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind unreachable]; } bb1: { 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 de94a55740318..eb63a76888de5 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,8 +26,8 @@ bb0: { StorageLive(_1); - _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 = AddWithOverflow(const 285212689_i32, const 285212689_i32); + assert(!move (_2.1: bool), "attempt to compute `{} + {}`, which would overflow", const 285212689_i32, const 285212689_i32) -> [success: bb1, unwind continue]; } bb1: { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir index 425b95db3363a..248a9909e2900 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-abort.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir index 425b95db3363a..248a9909e2900 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.32bit.panic-unwind.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir index 425b95db3363a..248a9909e2900 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-abort.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir index 425b95db3363a..248a9909e2900 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.main.SimplifyLocals-final.after.64bit.panic-unwind.mir @@ -3,7 +3,7 @@ fn main() -> () { let mut _0: (); scope 1 { - debug x => const 4_i32; + debug x => const 570425378_i32; scope 2 { debug y => const 3_i32; scope 3 { diff --git a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs index de5e2d5c3121b..9bbfe82298eaa 100644 --- a/tests/mir-opt/pre-codegen/optimizes_into_variable.rs +++ b/tests/mir-opt/pre-codegen/optimizes_into_variable.rs @@ -13,7 +13,7 @@ struct Point { // EMIT_MIR optimizes_into_variable.main.SimplifyLocals-final.after.mir // EMIT_MIR optimizes_into_variable.main.PreCodegen.after.mir fn main() { - let x = 2 + 2; + let x = 0x11000011 + 0x11000011; // Endian-invariant value. let y = [0, 1, 2, 3, 4, 5][3]; let z = (Point { x: 12, y: 42 }).y; }