]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/dataflow-const-prop/checked.main.DataflowConstProp.diff
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / mir-opt / dataflow-const-prop / checked.main.DataflowConstProp.diff
1 - // MIR for `main` before DataflowConstProp
2 + // MIR for `main` after DataflowConstProp
3
4 fn main() -> () {
5 let mut _0: (); // return place in scope 0 at $DIR/checked.rs:+0:11: +0:11
6 let _1: i32; // in scope 0 at $DIR/checked.rs:+1:9: +1:10
7 let mut _4: i32; // in scope 0 at $DIR/checked.rs:+3:13: +3:14
8 let mut _5: i32; // in scope 0 at $DIR/checked.rs:+3:17: +3:18
9 let mut _6: (i32, bool); // in scope 0 at $DIR/checked.rs:+3:13: +3:18
10 let mut _9: i32; // in scope 0 at $DIR/checked.rs:+6:13: +6:14
11 let mut _10: (i32, bool); // in scope 0 at $DIR/checked.rs:+6:13: +6:18
12 scope 1 {
13 debug a => _1; // in scope 1 at $DIR/checked.rs:+1:9: +1:10
14 let _2: i32; // in scope 1 at $DIR/checked.rs:+2:9: +2:10
15 scope 2 {
16 debug b => _2; // in scope 2 at $DIR/checked.rs:+2:9: +2:10
17 let _3: i32; // in scope 2 at $DIR/checked.rs:+3:9: +3:10
18 scope 3 {
19 debug c => _3; // in scope 3 at $DIR/checked.rs:+3:9: +3:10
20 let _7: i32; // in scope 3 at $DIR/checked.rs:+5:9: +5:10
21 scope 4 {
22 debug d => _7; // in scope 4 at $DIR/checked.rs:+5:9: +5:10
23 let _8: i32; // in scope 4 at $DIR/checked.rs:+6:9: +6:10
24 scope 5 {
25 debug e => _8; // in scope 5 at $DIR/checked.rs:+6:9: +6:10
26 }
27 }
28 }
29 }
30 }
31
32 bb0: {
33 StorageLive(_1); // scope 0 at $DIR/checked.rs:+1:9: +1:10
34 _1 = const 1_i32; // scope 0 at $DIR/checked.rs:+1:13: +1:14
35 StorageLive(_2); // scope 1 at $DIR/checked.rs:+2:9: +2:10
36 _2 = const 2_i32; // scope 1 at $DIR/checked.rs:+2:13: +2:14
37 StorageLive(_3); // scope 2 at $DIR/checked.rs:+3:9: +3:10
38 StorageLive(_4); // scope 2 at $DIR/checked.rs:+3:13: +3:14
39 - _4 = _1; // scope 2 at $DIR/checked.rs:+3:13: +3:14
40 + _4 = const 1_i32; // scope 2 at $DIR/checked.rs:+3:13: +3:14
41 StorageLive(_5); // scope 2 at $DIR/checked.rs:+3:17: +3:18
42 - _5 = _2; // scope 2 at $DIR/checked.rs:+3:17: +3:18
43 - _6 = CheckedAdd(_4, _5); // scope 2 at $DIR/checked.rs:+3:13: +3:18
44 - assert(!move (_6.1: bool), "attempt to compute `{} + {}`, which would overflow", move _4, move _5) -> bb1; // scope 2 at $DIR/checked.rs:+3:13: +3:18
45 + _5 = const 2_i32; // scope 2 at $DIR/checked.rs:+3:17: +3:18
46 + _6 = CheckedAdd(const 1_i32, const 2_i32); // scope 2 at $DIR/checked.rs:+3:13: +3:18
47 + assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 1_i32, const 2_i32) -> bb1; // scope 2 at $DIR/checked.rs:+3:13: +3:18
48 }
49
50 bb1: {
51 - _3 = move (_6.0: i32); // scope 2 at $DIR/checked.rs:+3:13: +3:18
52 + _3 = const 3_i32; // scope 2 at $DIR/checked.rs:+3:13: +3:18
53 StorageDead(_5); // scope 2 at $DIR/checked.rs:+3:17: +3:18
54 StorageDead(_4); // scope 2 at $DIR/checked.rs:+3:17: +3:18
55 StorageLive(_7); // scope 3 at $DIR/checked.rs:+5:9: +5:10
56 _7 = const _; // scope 3 at $DIR/checked.rs:+5:13: +5:21
57 StorageLive(_8); // scope 4 at $DIR/checked.rs:+6:9: +6:10
58 StorageLive(_9); // scope 4 at $DIR/checked.rs:+6:13: +6:14
59 - _9 = _7; // scope 4 at $DIR/checked.rs:+6:13: +6:14
60 - _10 = CheckedAdd(_9, const 1_i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
61 - assert(!move (_10.1: bool), "attempt to compute `{} + {}`, which would overflow", move _9, const 1_i32) -> bb2; // scope 4 at $DIR/checked.rs:+6:13: +6:18
62 + _9 = const i32::MAX; // scope 4 at $DIR/checked.rs:+6:13: +6:14
63 + _10 = CheckedAdd(const i32::MAX, const 1_i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
64 + assert(!const true, "attempt to compute `{} + {}`, which would overflow", const i32::MAX, const 1_i32) -> bb2; // scope 4 at $DIR/checked.rs:+6:13: +6:18
65 }
66
67 bb2: {
68 - _8 = move (_10.0: i32); // scope 4 at $DIR/checked.rs:+6:13: +6:18
69 + _8 = const i32::MIN; // scope 4 at $DIR/checked.rs:+6:13: +6:18
70 StorageDead(_9); // scope 4 at $DIR/checked.rs:+6:17: +6:18
71 _0 = const (); // scope 0 at $DIR/checked.rs:+0:11: +7:2
72 StorageDead(_8); // scope 4 at $DIR/checked.rs:+7:1: +7:2
73 StorageDead(_7); // scope 3 at $DIR/checked.rs:+7:1: +7:2
74 StorageDead(_3); // scope 2 at $DIR/checked.rs:+7:1: +7:2
75 StorageDead(_2); // scope 1 at $DIR/checked.rs:+7:1: +7:2
76 StorageDead(_1); // scope 0 at $DIR/checked.rs:+7:1: +7:2
77 return; // scope 0 at $DIR/checked.rs:+7:2: +7:2
78 }
79 }
80