]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/bool_compare.rs
Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514
[rust.git] / src / test / mir-opt / bool_compare.rs
1 // EMIT_MIR bool_compare.opt1.InstCombine.diff
2 fn opt1(x: bool) -> u32 {
3     if x != true { 0 } else { 1 }
4 }
5
6 // EMIT_MIR bool_compare.opt2.InstCombine.diff
7 fn opt2(x: bool) -> u32 {
8     if true != x { 0 } else { 1 }
9 }
10
11 // EMIT_MIR bool_compare.opt3.InstCombine.diff
12 fn opt3(x: bool) -> u32 {
13     if x == false { 0 } else { 1 }
14 }
15
16 // EMIT_MIR bool_compare.opt4.InstCombine.diff
17 fn opt4(x: bool) -> u32 {
18     if false == x { 0 } else { 1 }
19 }
20
21 fn main() {
22     opt1(false);
23     opt2(false);
24     opt3(false);
25     opt4(false);
26 }