]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/const_prop/read_immutable_static.rs
Render const pointers in MIR more compactly
[rust.git] / src / test / mir-opt / const_prop / read_immutable_static.rs
1 // compile-flags: -O
2
3 static FOO: u8 = 2;
4
5 fn main() {
6     let x = FOO + FOO;
7 }
8
9 // END RUST SOURCE
10 // START rustc.main.ConstProp.before.mir
11 //  bb0: {
12 //      ...
13 //      _3 = const Scalar(alloc0+0) : &u8;
14 //      _2 = (*_3);
15 //      ...
16 //      _5 = const Scalar(alloc0+0) : &u8;
17 //      _4 = (*_5);
18 //      _1 = Add(move _2, move _4);
19 //      ...
20 //  }
21 // END rustc.main.ConstProp.before.mir
22 // START rustc.main.ConstProp.after.mir
23 //  bb0: {
24 //      ...
25 //      _2 = const 2u8;
26 //      ...
27 //      _4 = const 2u8;
28 //      _1 = const 4u8;
29 //      ...
30 //  }
31 // END rustc.main.ConstProp.after.mir