]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff
d9852539844c9742519bc933fa168834df0f9fa5
[rust.git] / src / test / mir-opt / const_prop / read_immutable_static / rustc.main.ConstProp.diff
1 - // MIR for `main` before ConstProp
2 + // MIR for `main` after ConstProp
3   
4   fn main() -> () {
5       let mut _0: ();                      // return place in scope 0 at $DIR/read_immutable_static.rs:6:11: 6:11
6       let _1: u8;                          // in scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
7       let mut _2: u8;                      // in scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
8       let mut _3: &u8;                     // in scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
9       let mut _4: u8;                      // in scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
10       let mut _5: &u8;                     // in scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
11       scope 1 {
12           debug x => _1;                   // in scope 1 at $DIR/read_immutable_static.rs:7:9: 7:10
13       }
14   
15       bb0: {
16           StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
17           StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
18           StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
19           _3 = const {alloc0+0: &u8};      // bb0[3]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
20                                            // ty::Const
21                                            // + ty: &u8
22                                            // + val: Value(Scalar(alloc0+0))
23                                            // mir::Constant
24                                            // + span: $DIR/read_immutable_static.rs:7:13: 7:16
25                                            // + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0)) }
26 -         _2 = (*_3);                      // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
27 +         _2 = const 2u8;                  // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
28 +                                          // ty::Const
29 +                                          // + ty: u8
30 +                                          // + val: Value(Scalar(0x02))
31 +                                          // mir::Constant
32 +                                          // + span: $DIR/read_immutable_static.rs:7:13: 7:16
33 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
34           StorageLive(_4);                 // bb0[5]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
35           StorageLive(_5);                 // bb0[6]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
36           _5 = const {alloc0+0: &u8};      // bb0[7]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
37                                            // ty::Const
38                                            // + ty: &u8
39                                            // + val: Value(Scalar(alloc0+0))
40                                            // mir::Constant
41                                            // + span: $DIR/read_immutable_static.rs:7:19: 7:22
42                                            // + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0)) }
43 -         _4 = (*_5);                      // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
44 -         _1 = Add(move _2, move _4);      // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
45 +         _4 = const 2u8;                  // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
46 +                                          // ty::Const
47 +                                          // + ty: u8
48 +                                          // + val: Value(Scalar(0x02))
49 +                                          // mir::Constant
50 +                                          // + span: $DIR/read_immutable_static.rs:7:19: 7:22
51 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
52 +         _1 = const 4u8;                  // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
53 +                                          // ty::Const
54 +                                          // + ty: u8
55 +                                          // + val: Value(Scalar(0x04))
56 +                                          // mir::Constant
57 +                                          // + span: $DIR/read_immutable_static.rs:7:13: 7:22
58 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x04)) }
59           StorageDead(_4);                 // bb0[10]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
60           StorageDead(_2);                 // bb0[11]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
61           StorageDead(_5);                 // bb0[12]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
62           StorageDead(_3);                 // bb0[13]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
63           _0 = const ();                   // bb0[14]: scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2
64                                            // ty::Const
65                                            // + ty: ()
66                                            // + val: Value(Scalar(<ZST>))
67                                            // mir::Constant
68                                            // + span: $DIR/read_immutable_static.rs:6:11: 8:2
69                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
70           StorageDead(_1);                 // bb0[15]: scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2
71           return;                          // bb0[16]: scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2
72       }
73   }
74   
75   alloc0 (static: FOO, size: 1, align: 1) {
76       02                                              │ .
77   }
78