]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/early_otherwise_branch.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / mir-opt / early_otherwise_branch.rs
1 // compile-flags: -Z mir-opt-level=4 -Z unsound-mir-opts
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 }