]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/early_otherwise_branch.rs
Auto merge of #83257 - RalfJung:miri, r=RalfJung
[rust.git] / src / test / mir-opt / early_otherwise_branch.rs
1 // compile-flags: -Z mir-opt-level=4
2 // EMIT_MIR early_otherwise_branch.opt1.EarlyOtherwiseBranch.diff
3 fn opt1(x: Option<u32>, y: Option<u32>) -> u32 {
4     match (x, y) {
5         (Some(a), Some(b)) => 0,
6         _ => 1,
7     }
8 }
9
10 // EMIT_MIR early_otherwise_branch.opt2.EarlyOtherwiseBranch.diff
11 fn opt2(x: Option<u32>, y: Option<u32>) -> u32 {
12     match (x, y) {
13         (Some(a), Some(b)) => 0,
14         (None, None) => 0,
15         _ => 1,
16     }
17 }
18
19 fn main() {
20     opt1(None, Some(0));
21     opt2(None, Some(0));
22 }