2023-10-16 12:36:39 -05:00
|
|
|
// skip-filecheck
|
2022-04-13 04:20:46 -05:00
|
|
|
// unit-test: EarlyOtherwiseBranch
|
2020-08-01 18:47:52 -05:00
|
|
|
|
|
|
|
// must not optimize as it does not follow the pattern of
|
|
|
|
// left and right hand side being the same variant
|
|
|
|
|
|
|
|
// EMIT_MIR early_otherwise_branch_noopt.noopt1.EarlyOtherwiseBranch.diff
|
2020-09-19 16:38:54 -05:00
|
|
|
fn noopt1(x: Option<u32>, y: Option<u32>) -> u32 {
|
|
|
|
match (x, y) {
|
2020-08-01 18:47:52 -05:00
|
|
|
(Some(a), Some(b)) => 0,
|
|
|
|
(Some(a), None) => 1,
|
|
|
|
(None, Some(b)) => 2,
|
2020-09-19 16:38:54 -05:00
|
|
|
(None, None) => 3,
|
2020-08-01 18:47:52 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
noopt1(None, Some(0));
|
|
|
|
}
|