]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/checked_add.rs
Auto merge of #60272 - Jakst:patch-1, r=Manishearth
[rust.git] / src / test / mir-opt / const_prop / checked_add.rs
1 // compile-flags: -C overflow-checks=on
2
3 fn main() {
4     let x: u32 = 1 + 1;
5 }
6
7 // END RUST SOURCE
8 // START rustc.main.ConstProp.before.mir
9 //  bb0: {
10 //      ...
11 //      _2 = CheckedAdd(const 1u32, const 1u32);
12 //      assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1;
13 //  }
14 // END rustc.main.ConstProp.before.mir
15 // START rustc.main.ConstProp.after.mir
16 //  bb0: {
17 //      ...
18 //      _2 = (const 2u32, const false);
19 //      assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1;
20 //  }
21 // END rustc.main.ConstProp.after.mir