]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/simplify_if.main.SimplifyConstCondition-after-const-prop.diff
Rollup merge of #99084 - RalfJung:write_bytes, r=thomcc
[rust.git] / src / test / mir-opt / simplify_if.main.SimplifyConstCondition-after-const-prop.diff
1 - // MIR for `main` before SimplifyConstCondition-after-const-prop
2 + // MIR for `main` after SimplifyConstCondition-after-const-prop
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/simplify_if.rs:5:11: 5:11
6       let mut _1: bool;                    // in scope 0 at $DIR/simplify_if.rs:6:8: 6:13
7       let _2: ();                          // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15
8   
9       bb0: {
10           StorageLive(_1);                 // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
11           _1 = const false;                // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
12 -         switchInt(const false) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
13 +         goto -> bb3;                     // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
14       }
15   
16       bb1: {
17           StorageLive(_2);                 // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
18           _2 = noop() -> bb2;              // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
19                                            // mir::Constant
20                                            // + span: $DIR/simplify_if.rs:7:9: 7:13
21                                            // + literal: Const { ty: fn() {noop}, val: Value(<ZST>) }
22       }
23   
24       bb2: {
25           StorageDead(_2);                 // scope 0 at $DIR/simplify_if.rs:7:15: 7:16
26           nop;                             // scope 0 at $DIR/simplify_if.rs:6:14: 8:6
27           goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
28       }
29   
30       bb3: {
31           nop;                             // scope 0 at $DIR/simplify_if.rs:8:6: 8:6
32           goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
33       }
34   
35       bb4: {
36           StorageDead(_1);                 // scope 0 at $DIR/simplify_if.rs:8:5: 8:6
37           return;                          // scope 0 at $DIR/simplify_if.rs:9:2: 9:2
38       }
39   }
40