]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/const_prop/return_place.add.ConstProp.diff
Rollup merge of #105784 - yanns:update_stdarch, r=Amanieu
[rust.git] / tests / mir-opt / const_prop / return_place.add.ConstProp.diff
1 - // MIR for `add` before ConstProp
2 + // MIR for `add` after ConstProp
3   
4   fn add() -> u32 {
5       let mut _0: u32;                     // return place in scope 0 at $DIR/return_place.rs:+0:13: +0:16
6       let mut _1: (u32, bool);             // in scope 0 at $DIR/return_place.rs:+1:5: +1:10
7   
8       bb0: {
9 -         _1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:+1:5: +1:10
10 -         assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
11 +         _1 = const (4_u32, false);       // scope 0 at $DIR/return_place.rs:+1:5: +1:10
12 +         assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:+1:5: +1:10
13       }
14   
15       bb1: {
16 -         _0 = move (_1.0: u32);           // scope 0 at $DIR/return_place.rs:+1:5: +1:10
17 +         _0 = const 4_u32;                // scope 0 at $DIR/return_place.rs:+1:5: +1:10
18           return;                          // scope 0 at $DIR/return_place.rs:+2:2: +2:2
19       }
20   }
21