summary refs log tree commit diff
path: root/src/test/mir-opt/const_prop/read_immutable_static.rs
blob: d14ec0397166f05cf2f9df071e8cc4e1ce227d26 (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
// compile-flags: -O

static FOO: u8 = 2;

fn main() {
    let x = FOO + FOO;
}

// END RUST SOURCE
// START rustc.main.ConstProp.before.mir
//  bb0: {
//      ...
//      _3 = const Scalar(AllocId(0).0x0) : &u8;
//      _2 = (*_3);
//      ...
//      _5 = const Scalar(AllocId(0).0x0) : &u8;
//      _4 = (*_5);
//      _1 = Add(move _2, move _4);
//      ...
//  }
// END rustc.main.ConstProp.before.mir
// START rustc.main.ConstProp.after.mir
//  bb0: {
//      ...
//      _2 = const 2u8;
//      ...
//      _4 = const 2u8;
//      _1 = Add(move _2, move _4);
//      ...
//  }
// END rustc.main.ConstProp.after.mir