]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
Show the values and computation that would overflow a const evaluation or propagation
[rust.git] / src / test / mir-opt / match_false_edges / rustc.full_tested_match2.PromoteTemps.before.mir
1 // MIR for `full_tested_match2` before PromoteTemps
2
3 fn full_tested_match2() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/match_false_edges.rs:25:29: 25:29
5     let mut _1: (i32, i32);              // in scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
6     let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
7     let mut _3: isize;                   // in scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
8     let mut _4: &std::option::Option<i32>; // in scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
9     let _5: i32;                         // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
10     let _6: &i32;                        // in scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
11     let mut _7: bool;                    // in scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
12     let mut _8: i32;                     // in scope 0 at $DIR/match_false_edges.rs:27:35: 27:36
13     let _9: i32;                         // in scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
14     let mut _10: i32;                    // in scope 0 at $DIR/match_false_edges.rs:29:24: 29:25
15     scope 1 {
16     }
17     scope 2 {
18         debug x => _5;                   // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15
19         debug x => _6;                   // in scope 2 at $DIR/match_false_edges.rs:27:14: 27:15
20     }
21     scope 3 {
22         debug y => _9;                   // in scope 3 at $DIR/match_false_edges.rs:29:14: 29:15
23     }
24
25     bb0: {
26         StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
27         StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
28         _2 = std::option::Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
29                                          // ty::Const
30                                          // + ty: i32
31                                          // + val: Value(Scalar(0x0000002a))
32                                          // mir::Constant
33                                          // + span: $DIR/match_false_edges.rs:26:24: 26:26
34                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
35         FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
36         _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
37         switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
38     }
39
40     bb1 (cleanup): {
41         resume;                          // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
42     }
43
44     bb2: {
45         falseEdge -> [real: bb10, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
46     }
47
48     bb3: {
49         falseEdge -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
50     }
51
52     bb4: {
53         StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
54         _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
55         StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
56         _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
57         _1 = (const 2_i32, move _10);    // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
58                                          // ty::Const
59                                          // + ty: i32
60                                          // + val: Value(Scalar(0x00000002))
61                                          // mir::Constant
62                                          // + span: $DIR/match_false_edges.rs:29:21: 29:22
63                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
64         StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
65         StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
66         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
67     }
68
69     bb5: {
70         unreachable;                     // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
71     }
72
73     bb6: {
74         StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
75         _6 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
76         _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
77         StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
78         _7 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
79                                          // ty::Const
80                                          // + ty: fn() -> bool {guard}
81                                          // + val: Value(Scalar(<ZST>))
82                                          // mir::Constant
83                                          // + span: $DIR/match_false_edges.rs:27:20: 27:25
84                                          // + literal: Const { ty: fn() -> bool {guard}, val: Value(Scalar(<ZST>)) }
85     }
86
87     bb7: {
88         switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
89     }
90
91     bb8: {
92         StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
93         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
94         FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
95         StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
96         _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
97         StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
98         _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
99         _1 = (const 1_i32, move _8);     // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
100                                          // ty::Const
101                                          // + ty: i32
102                                          // + val: Value(Scalar(0x00000001))
103                                          // mir::Constant
104                                          // + span: $DIR/match_false_edges.rs:27:32: 27:33
105                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
106         StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
107         StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
108         StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
109         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
110     }
111
112     bb9: {
113         StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
114         StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
115         falseEdge -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
116     }
117
118     bb10: {
119         _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
120                                          // ty::Const
121                                          // + ty: i32
122                                          // + val: Value(Scalar(0x00000003))
123                                          // mir::Constant
124                                          // + span: $DIR/match_false_edges.rs:28:18: 28:19
125                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
126                                          // ty::Const
127                                          // + ty: i32
128                                          // + val: Value(Scalar(0x00000003))
129                                          // mir::Constant
130                                          // + span: $DIR/match_false_edges.rs:28:21: 28:22
131                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
132         goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
133     }
134
135     bb11: {
136         StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
137         StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
138         _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
139                                          // ty::Const
140                                          // + ty: ()
141                                          // + val: Value(Scalar(<ZST>))
142                                          // mir::Constant
143                                          // + span: $DIR/match_false_edges.rs:25:29: 31:2
144                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
145         return;                          // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
146     }
147 }