summary refs log tree commit diff
path: root/src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff
blob: 16f937f3e7b5efd7fb33f0a787d50fadcb3bc130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
- // MIR for `main` before ConstProp
+ // MIR for `main` after ConstProp
  
  fn main() -> () {
      let mut _0: ();                      // return place in scope 0 at $DIR/boxes.rs:11:11: 11:11
      let _1: i32;                         // in scope 0 at $DIR/boxes.rs:12:9: 12:10
      let mut _2: i32;                     // in scope 0 at $DIR/boxes.rs:12:13: 12:22
      let mut _3: std::boxed::Box<i32>;    // in scope 0 at $DIR/boxes.rs:12:14: 12:22
      let mut _4: std::boxed::Box<i32>;    // in scope 0 at $DIR/boxes.rs:12:14: 12:22
      scope 1 {
          debug x => _1;                   // in scope 1 at $DIR/boxes.rs:12:9: 12:10
      }
  
      bb0: {
          StorageLive(_1);                 // scope 0 at $DIR/boxes.rs:12:9: 12:10
          StorageLive(_2);                 // scope 0 at $DIR/boxes.rs:12:13: 12:22
          StorageLive(_3);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
          StorageLive(_4);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
          _4 = Box(i32);                   // scope 0 at $DIR/boxes.rs:12:14: 12:22
          (*_4) = const 42i32;             // scope 0 at $DIR/boxes.rs:12:19: 12:21
                                           // ty::Const
                                           // + ty: i32
                                           // + val: Value(Scalar(0x0000002a))
                                           // mir::Constant
                                           // + span: $DIR/boxes.rs:12:19: 12:21
                                           // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
          _3 = move _4;                    // scope 0 at $DIR/boxes.rs:12:14: 12:22
          StorageDead(_4);                 // scope 0 at $DIR/boxes.rs:12:21: 12:22
          _2 = (*_3);                      // scope 0 at $DIR/boxes.rs:12:13: 12:22
          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/boxes.rs:12:13: 12:26
                                           // ty::Const
                                           // + ty: i32
                                           // + val: Value(Scalar(0x00000000))
                                           // mir::Constant
                                           // + span: $DIR/boxes.rs:12:25: 12:26
                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
          StorageDead(_2);                 // scope 0 at $DIR/boxes.rs:12:25: 12:26
          drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
      }
  
      bb1 (cleanup): {
          resume;                          // scope 0 at $DIR/boxes.rs:11:1: 13:2
      }
  
      bb2: {
          StorageDead(_3);                 // scope 0 at $DIR/boxes.rs:12:26: 12:27
          _0 = const ();                   // scope 0 at $DIR/boxes.rs:11:11: 13:2
                                           // ty::Const
                                           // + ty: ()
                                           // + val: Value(Scalar(<ZST>))
                                           // mir::Constant
                                           // + span: $DIR/boxes.rs:11:11: 13:2
                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
          StorageDead(_1);                 // scope 0 at $DIR/boxes.rs:13:1: 13:2
          return;                          // scope 0 at $DIR/boxes.rs:13:2: 13:2
      }
  }