-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FileCheck uninhabited_enum_branching.
- Loading branch information
Showing
7 changed files
with
126 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tests/mir-opt/uninhabited_enum_branching.custom_discriminant.UninhabitedEnumBranching.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: bb1, otherwise: bb2]; | ||
+ switchInt(move _3) -> [4: bb3, 5: bb1, otherwise: bb5]; | ||
} | ||
|
||
bb1: { | ||
StorageLive(_4); | ||
_4 = const "E"; | ||
_1 = &(*_4); | ||
StorageDead(_4); | ||
goto -> bb4; | ||
} | ||
|
||
bb2: { | ||
unreachable; | ||
} | ||
|
||
bb3: { | ||
_1 = const "D"; | ||
goto -> bb4; | ||
} | ||
|
||
bb4: { | ||
StorageDead(_2); | ||
StorageDead(_1); | ||
_0 = const (); | ||
return; | ||
+ } | ||
+ | ||
+ bb5: { | ||
+ unreachable; | ||
} | ||
} | ||
|
65 changes: 0 additions & 65 deletions
65
...pt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.