]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / test / mir-opt / const_prop / indirect / 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/indirect.rs:4:11: 4:11
6 let _1: u8; // in scope 0 at $DIR/indirect.rs:5:9: 5:10
7 let mut _2: u8; // in scope 0 at $DIR/indirect.rs:5:13: 5:25
8 let mut _3: (u8, bool); // in scope 0 at $DIR/indirect.rs:5:13: 5:29
9 scope 1 {
10 debug x => _1; // in scope 1 at $DIR/indirect.rs:5:9: 5:10
11 }
12
13 bb0: {
14 StorageLive(_1); // scope 0 at $DIR/indirect.rs:5:9: 5:10
15 StorageLive(_2); // scope 0 at $DIR/indirect.rs:5:13: 5:25
16 - _2 = const 2_u32 as u8 (Misc); // scope 0 at $DIR/indirect.rs:5:13: 5:25
17 + _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:25
18 // ty::Const
19 - // + ty: u32
20 - // + val: Value(Scalar(0x00000002))
21 + // + ty: u8
22 + // + val: Value(Scalar(0x02))
23 // mir::Constant
24 - // + span: $DIR/indirect.rs:5:14: 5:18
25 - // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
26 - _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
27 + // + span: $DIR/indirect.rs:5:13: 5:25
28 + // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
29 + _3 = (const 3_u8, const false); // scope 0 at $DIR/indirect.rs:5:13: 5:29
30 // ty::Const
31 // + ty: u8
32 - // + val: Value(Scalar(0x01))
33 + // + val: Value(Scalar(0x03))
34 // mir::Constant
35 - // + span: $DIR/indirect.rs:5:28: 5:29
36 - // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
37 - assert(!move (_3.1: bool), "attempt to compute `{} + {}` which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
38 + // + span: $DIR/indirect.rs:5:13: 5:29
39 + // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
40 // ty::Const
41 + // + ty: bool
42 + // + val: Value(Scalar(0x00))
43 + // mir::Constant
44 + // + span: $DIR/indirect.rs:5:13: 5:29
45 + // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
46 + assert(!const false, "attempt to compute `{} + {}` which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
47 + // ty::Const
48 + // + ty: bool
49 + // + val: Value(Scalar(0x00))
50 + // mir::Constant
51 + // + span: $DIR/indirect.rs:5:13: 5:29
52 + // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
53 + // ty::Const
54 // + ty: u8
55 // + val: Value(Scalar(0x01))
56 // mir::Constant
57 // + span: $DIR/indirect.rs:5:28: 5:29
58 // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
59 }
60
61 bb1: {
62 - _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
63 + _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:29
64 + // ty::Const
65 + // + ty: u8
66 + // + val: Value(Scalar(0x03))
67 + // mir::Constant
68 + // + span: $DIR/indirect.rs:5:13: 5:29
69 + // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
70 StorageDead(_2); // scope 0 at $DIR/indirect.rs:5:28: 5:29
71 _0 = const (); // scope 0 at $DIR/indirect.rs:4:11: 6:2
72 // ty::Const
73 // + ty: ()
74 // + val: Value(Scalar(<ZST>))
75 // mir::Constant
76 // + span: $DIR/indirect.rs:4:11: 6:2
77 // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
78 StorageDead(_1); // scope 0 at $DIR/indirect.rs:6:1: 6:2
79 return; // scope 0 at $DIR/indirect.rs:6:2: 6:2
80 }
81 }
82