-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df3de7b
commit 89ea69a
Showing
1 changed file
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Test that we don't generate unnecessarily large MIR for very simple matches | ||
|
||
fn match_bool(x: bool) -> usize { | ||
match x { | ||
true => 10, | ||
_ => 20, | ||
} | ||
} | ||
|
||
fn main() {} | ||
|
||
|
||
// END RUST SOURCE | ||
// START rustc.match_bool.mir_map.0.mir | ||
// bb0: { | ||
// FakeRead(ForMatchedPlace, _1); | ||
// switchInt(_1) -> [false: bb3, otherwise: bb2]; | ||
// } | ||
// bb1 (cleanup): { | ||
// resume; | ||
// } | ||
// bb2: { | ||
// falseEdges -> [real: bb4, imaginary: bb3]; | ||
// } | ||
// bb3: { | ||
// _0 = const 20usize; | ||
// goto -> bb5; | ||
// } | ||
// bb4: { | ||
// _0 = const 10usize; | ||
// goto -> bb5; | ||
// } | ||
// bb5: { | ||
// goto -> bb6; | ||
// } | ||
// bb6: { | ||
// return; | ||
// } | ||
// END rustc.match_bool.mir_map.0.mir |