]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/switch_int.rs
Rollup merge of #60959 - petrochenkov:sassert, r=estebank
[rust.git] / src / test / mir-opt / const_prop / switch_int.rs
1 #[inline(never)]
2 fn foo(_: i32) { }
3
4 fn main() {
5     match 1 {
6         1 => foo(0),
7         _ => foo(-1),
8     }
9 }
10
11 // END RUST SOURCE
12 // START rustc.main.ConstProp.before.mir
13 //  bb0: {
14 //      ...
15 //      _1 = const 1i32;
16 //      switchInt(_1) -> [1i32: bb1, otherwise: bb2];
17 //  }
18 // END rustc.main.ConstProp.before.mir
19 // START rustc.main.ConstProp.after.mir
20 //  bb0: {
21 //      ...
22 //      switchInt(const 1i32) -> [1i32: bb1, otherwise: bb2];
23 //  }
24 // END rustc.main.ConstProp.after.mir
25 // START rustc.main.SimplifyBranches-after-const-prop.before.mir
26 //  bb0: {
27 //      ...
28 //      _1 = const 1i32;
29 //      switchInt(const 1i32) -> [1i32: bb1, otherwise: bb2];
30 //  }
31 // END rustc.main.SimplifyBranches-after-const-prop.before.mir
32 // START rustc.main.SimplifyBranches-after-const-prop.after.mir
33 //  bb0: {
34 //      ...
35 //      _1 = const 1i32;
36 //      goto -> bb1;
37 //  }
38 // END rustc.main.SimplifyBranches-after-const-prop.after.mir