summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/issue_99325.main.built.after.mir
blob: 0fe66d3fb7021db8b66dca31126d82c8a16828f1 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
// MIR for `main` after built

| User Type Annotations
| 0: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)]) }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
| 1: user_ty: Canonical { value: TypeOf(DefId(0:3 ~ issue_99325[22bb]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: UnevaluatedConst { def: DefId(0:8 ~ issue_99325[22bb]::main::{constant#1}), substs: [] } }], user_self_ty: None }), max_universe: U0, variables: [] }, span: $DIR/issue_99325.rs:11:16: 11:68, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">}
|
fn main() -> () {
    let mut _0: ();
    let _1: ();
    let mut _2: (&&[u8], &&[u8; 4]);
    let mut _3: &&[u8];
    let _4: &[u8];
    let mut _5: &&[u8; 4];
    let _6: &[u8; 4];
    let _7: [u8; 4];
    let _8: &&[u8];
    let _9: &&[u8; 4];
    let mut _10: bool;
    let mut _11: bool;
    let mut _12: &&[u8];
    let mut _13: &&[u8; 4];
    let mut _14: !;
    let _16: !;
    let mut _17: core::panicking::AssertKind;
    let mut _18: &&[u8];
    let _19: &&[u8];
    let mut _20: &&[u8; 4];
    let _21: &&[u8; 4];
    let mut _22: std::option::Option<std::fmt::Arguments<'_>>;
    let _23: ();
    let mut _24: (&&[u8], &&[u8; 4]);
    let mut _25: &&[u8];
    let _26: &[u8];
    let mut _27: &&[u8; 4];
    let _28: &[u8; 4];
    let _29: &&[u8];
    let _30: &&[u8; 4];
    let mut _31: bool;
    let mut _32: bool;
    let mut _33: &&[u8];
    let mut _34: &&[u8; 4];
    let mut _35: !;
    let _37: !;
    let mut _38: core::panicking::AssertKind;
    let mut _39: &&[u8];
    let _40: &&[u8];
    let mut _41: &&[u8; 4];
    let _42: &&[u8; 4];
    let mut _43: std::option::Option<std::fmt::Arguments<'_>>;
    scope 1 {
        debug left_val => _8;
        debug right_val => _9;
        let _15: core::panicking::AssertKind;
        scope 2 {
            debug kind => _15;
        }
    }
    scope 3 {
        debug left_val => _29;
        debug right_val => _30;
        let _36: core::panicking::AssertKind;
        scope 4 {
            debug kind => _36;
        }
    }

    bb0: {
        StorageLive(_1);
        StorageLive(_2);
        StorageLive(_3);
        StorageLive(_4);
        _4 = function_with_bytes::<&*b"AAAA">() -> [return: bb1, unwind: bb19];
    }

    bb1: {
        _3 = &_4;
        StorageLive(_5);
        StorageLive(_6);
        StorageLive(_7);
        _7 = [const 65_u8, const 65_u8, const 65_u8, const 65_u8];
        _6 = &_7;
        _5 = &_6;
        _2 = (move _3, move _5);
        StorageDead(_5);
        StorageDead(_3);
        FakeRead(ForMatchedPlace(None), _2);
        StorageLive(_8);
        _8 = (_2.0: &&[u8]);
        StorageLive(_9);
        _9 = (_2.1: &&[u8; 4]);
        StorageLive(_10);
        StorageLive(_11);
        StorageLive(_12);
        _12 = &(*_8);
        StorageLive(_13);
        _13 = &(*_9);
        _11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19];
    }

    bb2: {
        StorageDead(_13);
        StorageDead(_12);
        _10 = Not(move _11);
        StorageDead(_11);
        switchInt(move _10) -> [0: bb4, otherwise: bb3];
    }

    bb3: {
        StorageLive(_15);
        _15 = core::panicking::AssertKind::Eq;
        FakeRead(ForLet(None), _15);
        StorageLive(_16);
        StorageLive(_17);
        _17 = move _15;
        StorageLive(_18);
        StorageLive(_19);
        _19 = &(*_8);
        _18 = &(*_19);
        StorageLive(_20);
        StorageLive(_21);
        _21 = &(*_9);
        _20 = &(*_21);
        StorageLive(_22);
        _22 = Option::<Arguments<'_>>::None;
        _16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19;
    }

    bb4: {
        goto -> bb7;
    }

    bb5: {
        StorageDead(_22);
        StorageDead(_20);
        StorageDead(_18);
        StorageDead(_17);
        StorageDead(_21);
        StorageDead(_19);
        StorageDead(_16);
        StorageDead(_15);
        unreachable;
    }

    bb6: {
        goto -> bb8;
    }

    bb7: {
        _1 = const ();
        goto -> bb8;
    }

    bb8: {
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_8);
        goto -> bb9;
    }

    bb9: {
        StorageDead(_7);
        StorageDead(_6);
        StorageDead(_4);
        StorageDead(_2);
        StorageDead(_1);
        StorageLive(_23);
        StorageLive(_24);
        StorageLive(_25);
        StorageLive(_26);
        _26 = function_with_bytes::<&*b"AAAA">() -> [return: bb10, unwind: bb19];
    }

    bb10: {
        _25 = &_26;
        StorageLive(_27);
        StorageLive(_28);
        _28 = const b"AAAA";
        _27 = &_28;
        _24 = (move _25, move _27);
        StorageDead(_27);
        StorageDead(_25);
        FakeRead(ForMatchedPlace(None), _24);
        StorageLive(_29);
        _29 = (_24.0: &&[u8]);
        StorageLive(_30);
        _30 = (_24.1: &&[u8; 4]);
        StorageLive(_31);
        StorageLive(_32);
        StorageLive(_33);
        _33 = &(*_29);
        StorageLive(_34);
        _34 = &(*_30);
        _32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19];
    }

    bb11: {
        StorageDead(_34);
        StorageDead(_33);
        _31 = Not(move _32);
        StorageDead(_32);
        switchInt(move _31) -> [0: bb13, otherwise: bb12];
    }

    bb12: {
        StorageLive(_36);
        _36 = core::panicking::AssertKind::Eq;
        FakeRead(ForLet(None), _36);
        StorageLive(_37);
        StorageLive(_38);
        _38 = move _36;
        StorageLive(_39);
        StorageLive(_40);
        _40 = &(*_29);
        _39 = &(*_40);
        StorageLive(_41);
        StorageLive(_42);
        _42 = &(*_30);
        _41 = &(*_42);
        StorageLive(_43);
        _43 = Option::<Arguments<'_>>::None;
        _37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19;
    }

    bb13: {
        goto -> bb16;
    }

    bb14: {
        StorageDead(_43);
        StorageDead(_41);
        StorageDead(_39);
        StorageDead(_38);
        StorageDead(_42);
        StorageDead(_40);
        StorageDead(_37);
        StorageDead(_36);
        unreachable;
    }

    bb15: {
        goto -> bb17;
    }

    bb16: {
        _23 = const ();
        goto -> bb17;
    }

    bb17: {
        StorageDead(_31);
        StorageDead(_30);
        StorageDead(_29);
        goto -> bb18;
    }

    bb18: {
        StorageDead(_28);
        StorageDead(_26);
        StorageDead(_24);
        StorageDead(_23);
        _0 = const ();
        return;
    }

    bb19 (cleanup): {
        resume;
    }
}

alloc4 (size: 4, align: 1) {
    41 41 41 41                                     │ AAAA
}