From d8b7b5be7d4738dae63fbc35ed4b44ef97cf7ca2 Mon Sep 17 00:00:00 2001 From: DianQK Date: Wed, 14 Feb 2024 09:19:31 +0800 Subject: Regenerate `uninhabited_enum_branching.rs` --- ...m_branching.byref.UninhabitedEnumBranching.diff | 119 --------------------- ...byref.UninhabitedEnumBranching.panic-abort.diff | 119 +++++++++++++++++++++ ...yref.UninhabitedEnumBranching.panic-unwind.diff | 119 +++++++++++++++++++++ ...stom_discriminant.UninhabitedEnumBranching.diff | 48 --------- ...inant.UninhabitedEnumBranching.panic-abort.diff | 48 +++++++++ ...nant.UninhabitedEnumBranching.panic-unwind.diff | 48 +++++++++ tests/mir-opt/uninhabited_enum_branching.rs | 2 + ..._branching.simple.UninhabitedEnumBranching.diff | 57 ---------- ...imple.UninhabitedEnumBranching.panic-abort.diff | 57 ++++++++++ ...mple.UninhabitedEnumBranching.panic-unwind.diff | 57 ++++++++++ 10 files changed, 450 insertions(+), 224 deletions(-) delete mode 100644 tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff delete mode 100644 tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff delete mode 100644 tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff create mode 100644 tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff diff --git a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.diff deleted file mode 100644 index 5a3544f8538..00000000000 --- a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.diff +++ /dev/null @@ -1,119 +0,0 @@ -- // MIR for `byref` before UninhabitedEnumBranching -+ // MIR for `byref` after UninhabitedEnumBranching - - fn byref() -> () { - let mut _0: (); - let _1: Plop; - let mut _2: Test3; - let _3: &str; - let mut _4: &Test3; - let mut _5: isize; - let _6: &str; - let _7: &str; - let _8: &str; - let _9: &str; - let mut _10: isize; - let _11: &str; - let _12: &str; - let _13: &str; - scope 1 { - debug plop => _1; - } - - bb0: { - StorageLive(_1); - StorageLive(_2); - _2 = Test3::C; - _1 = Plop { xx: const 51_u32, test3: move _2 }; - StorageDead(_2); - StorageLive(_3); - StorageLive(_4); - _4 = &(_1.1: Test3); - _5 = discriminant((*_4)); -- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb2, otherwise: bb1]; -+ switchInt(move _5) -> [0: bb12, 1: bb12, 2: bb5, 3: bb2, otherwise: bb12]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_8); - _8 = const "D"; - _3 = &(*_8); - StorageDead(_8); - goto -> bb6; - } - - bb3: { - _3 = const "A(Empty)"; - goto -> bb6; - } - - bb4: { - StorageLive(_6); - _6 = const "B(Empty)"; - _3 = &(*_6); - StorageDead(_6); - goto -> bb6; - } - - bb5: { - StorageLive(_7); - _7 = const "C"; - _3 = &(*_7); - StorageDead(_7); - goto -> bb6; - } - - bb6: { - StorageDead(_4); - StorageDead(_3); - StorageLive(_9); - _10 = discriminant((_1.1: Test3)); -- switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb1]; -+ switchInt(move _10) -> [0: bb12, 1: bb12, 2: bb10, 3: bb7, otherwise: bb12]; - } - - bb7: { - StorageLive(_13); - _13 = const "D"; - _9 = &(*_13); - StorageDead(_13); - goto -> bb11; - } - - bb8: { - _9 = const "A(Empty)"; - goto -> bb11; - } - - bb9: { - StorageLive(_11); - _11 = const "B(Empty)"; - _9 = &(*_11); - StorageDead(_11); - goto -> bb11; - } - - bb10: { - StorageLive(_12); - _12 = const "C"; - _9 = &(*_12); - StorageDead(_12); - goto -> bb11; - } - - bb11: { - StorageDead(_9); - _0 = const (); - StorageDead(_1); - return; -+ } -+ -+ bb12: { -+ unreachable; - } - } - diff --git a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff new file mode 100644 index 00000000000..5a3544f8538 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-abort.diff @@ -0,0 +1,119 @@ +- // MIR for `byref` before UninhabitedEnumBranching ++ // MIR for `byref` after UninhabitedEnumBranching + + fn byref() -> () { + let mut _0: (); + let _1: Plop; + let mut _2: Test3; + let _3: &str; + let mut _4: &Test3; + let mut _5: isize; + let _6: &str; + let _7: &str; + let _8: &str; + let _9: &str; + let mut _10: isize; + let _11: &str; + let _12: &str; + let _13: &str; + scope 1 { + debug plop => _1; + } + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test3::C; + _1 = Plop { xx: const 51_u32, test3: move _2 }; + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + _4 = &(_1.1: Test3); + _5 = discriminant((*_4)); +- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb2, otherwise: bb1]; ++ switchInt(move _5) -> [0: bb12, 1: bb12, 2: bb5, 3: bb2, otherwise: bb12]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_8); + _8 = const "D"; + _3 = &(*_8); + StorageDead(_8); + goto -> bb6; + } + + bb3: { + _3 = const "A(Empty)"; + goto -> bb6; + } + + bb4: { + StorageLive(_6); + _6 = const "B(Empty)"; + _3 = &(*_6); + StorageDead(_6); + goto -> bb6; + } + + bb5: { + StorageLive(_7); + _7 = const "C"; + _3 = &(*_7); + StorageDead(_7); + goto -> bb6; + } + + bb6: { + StorageDead(_4); + StorageDead(_3); + StorageLive(_9); + _10 = discriminant((_1.1: Test3)); +- switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb1]; ++ switchInt(move _10) -> [0: bb12, 1: bb12, 2: bb10, 3: bb7, otherwise: bb12]; + } + + bb7: { + StorageLive(_13); + _13 = const "D"; + _9 = &(*_13); + StorageDead(_13); + goto -> bb11; + } + + bb8: { + _9 = const "A(Empty)"; + goto -> bb11; + } + + bb9: { + StorageLive(_11); + _11 = const "B(Empty)"; + _9 = &(*_11); + StorageDead(_11); + goto -> bb11; + } + + bb10: { + StorageLive(_12); + _12 = const "C"; + _9 = &(*_12); + StorageDead(_12); + goto -> bb11; + } + + bb11: { + StorageDead(_9); + _0 = const (); + StorageDead(_1); + return; ++ } ++ ++ bb12: { ++ unreachable; + } + } + diff --git a/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff new file mode 100644 index 00000000000..5a3544f8538 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.byref.UninhabitedEnumBranching.panic-unwind.diff @@ -0,0 +1,119 @@ +- // MIR for `byref` before UninhabitedEnumBranching ++ // MIR for `byref` after UninhabitedEnumBranching + + fn byref() -> () { + let mut _0: (); + let _1: Plop; + let mut _2: Test3; + let _3: &str; + let mut _4: &Test3; + let mut _5: isize; + let _6: &str; + let _7: &str; + let _8: &str; + let _9: &str; + let mut _10: isize; + let _11: &str; + let _12: &str; + let _13: &str; + scope 1 { + debug plop => _1; + } + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test3::C; + _1 = Plop { xx: const 51_u32, test3: move _2 }; + StorageDead(_2); + StorageLive(_3); + StorageLive(_4); + _4 = &(_1.1: Test3); + _5 = discriminant((*_4)); +- switchInt(move _5) -> [0: bb3, 1: bb4, 2: bb5, 3: bb2, otherwise: bb1]; ++ switchInt(move _5) -> [0: bb12, 1: bb12, 2: bb5, 3: bb2, otherwise: bb12]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_8); + _8 = const "D"; + _3 = &(*_8); + StorageDead(_8); + goto -> bb6; + } + + bb3: { + _3 = const "A(Empty)"; + goto -> bb6; + } + + bb4: { + StorageLive(_6); + _6 = const "B(Empty)"; + _3 = &(*_6); + StorageDead(_6); + goto -> bb6; + } + + bb5: { + StorageLive(_7); + _7 = const "C"; + _3 = &(*_7); + StorageDead(_7); + goto -> bb6; + } + + bb6: { + StorageDead(_4); + StorageDead(_3); + StorageLive(_9); + _10 = discriminant((_1.1: Test3)); +- switchInt(move _10) -> [0: bb8, 1: bb9, 2: bb10, 3: bb7, otherwise: bb1]; ++ switchInt(move _10) -> [0: bb12, 1: bb12, 2: bb10, 3: bb7, otherwise: bb12]; + } + + bb7: { + StorageLive(_13); + _13 = const "D"; + _9 = &(*_13); + StorageDead(_13); + goto -> bb11; + } + + bb8: { + _9 = const "A(Empty)"; + goto -> bb11; + } + + bb9: { + StorageLive(_11); + _11 = const "B(Empty)"; + _9 = &(*_11); + StorageDead(_11); + goto -> bb11; + } + + bb10: { + StorageLive(_12); + _12 = const "C"; + _9 = &(*_12); + StorageDead(_12); + goto -> bb11; + } + + bb11: { + StorageDead(_9); + _0 = const (); + StorageDead(_1); + return; ++ } ++ ++ bb12: { ++ unreachable; + } + } + diff --git a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff deleted file mode 100644 index 121374553ed..00000000000 --- a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff +++ /dev/null @@ -1,48 +0,0 @@ -- // MIR for `custom_discriminant` before UninhabitedEnumBranching -+ // MIR for `custom_discriminant` after UninhabitedEnumBranching - - fn custom_discriminant() -> () { - let mut _0: (); - let _1: &str; - let mut _2: Test2; - let mut _3: isize; - let _4: &str; - - bb0: { - StorageLive(_1); - StorageLive(_2); - _2 = Test2::D; - _3 = discriminant(_2); -- switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb1]; -+ switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb5]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_4); - _4 = const "E"; - _1 = &(*_4); - StorageDead(_4); - goto -> bb4; - } - - bb3: { - _1 = const "D"; - goto -> bb4; - } - - bb4: { - StorageDead(_2); - StorageDead(_1); - _0 = const (); - return; -+ } -+ -+ bb5: { -+ unreachable; - } - } - diff --git a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff new file mode 100644 index 00000000000..121374553ed --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-abort.diff @@ -0,0 +1,48 @@ +- // MIR for `custom_discriminant` before UninhabitedEnumBranching ++ // MIR for `custom_discriminant` after UninhabitedEnumBranching + + fn custom_discriminant() -> () { + let mut _0: (); + let _1: &str; + let mut _2: Test2; + let mut _3: isize; + let _4: &str; + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test2::D; + _3 = discriminant(_2); +- switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb1]; ++ switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb5]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_4); + _4 = const "E"; + _1 = &(*_4); + StorageDead(_4); + goto -> bb4; + } + + bb3: { + _1 = const "D"; + goto -> bb4; + } + + bb4: { + StorageDead(_2); + StorageDead(_1); + _0 = const (); + return; ++ } ++ ++ bb5: { ++ unreachable; + } + } + diff --git a/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff new file mode 100644 index 00000000000..121374553ed --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.panic-unwind.diff @@ -0,0 +1,48 @@ +- // MIR for `custom_discriminant` before UninhabitedEnumBranching ++ // MIR for `custom_discriminant` after UninhabitedEnumBranching + + fn custom_discriminant() -> () { + let mut _0: (); + let _1: &str; + let mut _2: Test2; + let mut _3: isize; + let _4: &str; + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test2::D; + _3 = discriminant(_2); +- switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb1]; ++ switchInt(move _3) -> [4: bb3, 5: bb2, otherwise: bb5]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_4); + _4 = const "E"; + _1 = &(*_4); + StorageDead(_4); + goto -> bb4; + } + + bb3: { + _1 = const "D"; + goto -> bb4; + } + + bb4: { + StorageDead(_2); + StorageDead(_1); + _0 = const (); + return; ++ } ++ ++ bb5: { ++ unreachable; + } + } + diff --git a/tests/mir-opt/uninhabited_enum_branching.rs b/tests/mir-opt/uninhabited_enum_branching.rs index 08eca57afc6..b955ff69b3d 100644 --- a/tests/mir-opt/uninhabited_enum_branching.rs +++ b/tests/mir-opt/uninhabited_enum_branching.rs @@ -1,4 +1,6 @@ //@ unit-test: UninhabitedEnumBranching +// EMIT_MIR_FOR_EACH_PANIC_STRATEGY + enum Empty {} // test matching an enum with uninhabited variants diff --git a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.diff b/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.diff deleted file mode 100644 index 6ce61e15287..00000000000 --- a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.diff +++ /dev/null @@ -1,57 +0,0 @@ -- // MIR for `simple` before UninhabitedEnumBranching -+ // MIR for `simple` after UninhabitedEnumBranching - - fn simple() -> () { - let mut _0: (); - let _1: &str; - let mut _2: Test1; - let mut _3: isize; - let _4: &str; - let _5: &str; - - bb0: { - StorageLive(_1); - StorageLive(_2); - _2 = Test1::C; - _3 = discriminant(_2); -- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1]; -+ switchInt(move _3) -> [0: bb6, 1: bb6, 2: bb2, otherwise: bb6]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_5); - _5 = const "C"; - _1 = &(*_5); - StorageDead(_5); - goto -> bb5; - } - - bb3: { - _1 = const "A(Empty)"; - goto -> bb5; - } - - bb4: { - StorageLive(_4); - _4 = const "B(Empty)"; - _1 = &(*_4); - StorageDead(_4); - goto -> bb5; - } - - bb5: { - StorageDead(_2); - StorageDead(_1); - _0 = const (); - return; -+ } -+ -+ bb6: { -+ unreachable; - } - } - diff --git a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff b/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff new file mode 100644 index 00000000000..6ce61e15287 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-abort.diff @@ -0,0 +1,57 @@ +- // MIR for `simple` before UninhabitedEnumBranching ++ // MIR for `simple` after UninhabitedEnumBranching + + fn simple() -> () { + let mut _0: (); + let _1: &str; + let mut _2: Test1; + let mut _3: isize; + let _4: &str; + let _5: &str; + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test1::C; + _3 = discriminant(_2); +- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1]; ++ switchInt(move _3) -> [0: bb6, 1: bb6, 2: bb2, otherwise: bb6]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_5); + _5 = const "C"; + _1 = &(*_5); + StorageDead(_5); + goto -> bb5; + } + + bb3: { + _1 = const "A(Empty)"; + goto -> bb5; + } + + bb4: { + StorageLive(_4); + _4 = const "B(Empty)"; + _1 = &(*_4); + StorageDead(_4); + goto -> bb5; + } + + bb5: { + StorageDead(_2); + StorageDead(_1); + _0 = const (); + return; ++ } ++ ++ bb6: { ++ unreachable; + } + } + diff --git a/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff b/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff new file mode 100644 index 00000000000..6ce61e15287 --- /dev/null +++ b/tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff @@ -0,0 +1,57 @@ +- // MIR for `simple` before UninhabitedEnumBranching ++ // MIR for `simple` after UninhabitedEnumBranching + + fn simple() -> () { + let mut _0: (); + let _1: &str; + let mut _2: Test1; + let mut _3: isize; + let _4: &str; + let _5: &str; + + bb0: { + StorageLive(_1); + StorageLive(_2); + _2 = Test1::C; + _3 = discriminant(_2); +- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1]; ++ switchInt(move _3) -> [0: bb6, 1: bb6, 2: bb2, otherwise: bb6]; + } + + bb1: { + unreachable; + } + + bb2: { + StorageLive(_5); + _5 = const "C"; + _1 = &(*_5); + StorageDead(_5); + goto -> bb5; + } + + bb3: { + _1 = const "A(Empty)"; + goto -> bb5; + } + + bb4: { + StorageLive(_4); + _4 = const "B(Empty)"; + _1 = &(*_4); + StorageDead(_4); + goto -> bb5; + } + + bb5: { + StorageDead(_2); + StorageDead(_1); + _0 = const (); + return; ++ } ++ ++ bb6: { ++ unreachable; + } + } + -- cgit 1.4.1-3-g733a5