summary refs log tree commit diff
path: root/src/test/mir-opt/issue-49232.rs
blob: d8365c8c9cc2374749969e8c249d8b1c2c3961df (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
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// We must mark a variable whose initialization fails due to an
// abort statement as StorageDead.

fn main() {
    loop {
        let beacon = {
            match true {
                false => 4,
                true => break,
            }
        };
        drop(&beacon);
    }
}

// END RUST SOURCE
// START rustc.main.mir_map.0.mir
// fn main() -> (){
//     let mut _0: ();
//     scope 1 {
//     }
//     scope 2 {
//         let _2: i32;
//     }
//     let mut _1: ();
//     let mut _3: bool;
//     let mut _4: !;
//     let mut _5: ();
//     let mut _6: &i32;
//     bb0: {
//         goto -> bb1;
//     }
//     bb1: {
//         falseUnwind -> [real: bb3, cleanup: bb4];
//     }
//     bb2: {
//         goto -> bb20;
//     }
//     bb3: {
//         StorageLive(_2);
//         StorageLive(_3);
//         _3 = const true;
//         FakeRead(ForMatchedPlace, _3);
//         switchInt(_3) -> [false: bb11, otherwise: bb10];
//     }
//     bb4: {
//         resume;
//     }
//     bb5: {
//         _2 = const 4i32;
//         goto -> bb14;
//     }
//     bb6: {
//         _0 = ();
//         goto -> bb15;
//     }
//     bb7: {
//         falseEdges -> [real: bb12, imaginary: bb8];
//     }
//     bb8: {
//         falseEdges -> [real: bb13, imaginary: bb9];
//     }
//     bb9: {
//         unreachable;
//     }
//     bb10: {
//         goto -> bb8;
//     }
//     bb11: {
//         goto -> bb7;
//     }
//     bb12: {
//         goto -> bb5;
//     }
//     bb13: {
//         goto -> bb6;
//     }
//     bb14: {
//         FakeRead(ForLet, _2);
//         StorageDead(_3);
//         StorageLive(_6);
//         _6 = &_2;
//         _5 = const std::mem::drop(move _6) -> [return: bb19, unwind: bb4];
//     }
//     bb15: {
//         StorageDead(_3);
//         goto -> bb16;
//     }
//     bb16: {
//         StorageDead(_2);
//         goto -> bb2;
//     }
//     bb17: {
//         _4 = ();
//         unreachable;
//     }
//     bb18: {
//         StorageDead(_4);
//         goto -> bb14;
//     }
//     bb19: {
//         StorageDead(_6);
//         _1 = ();
//         StorageDead(_2);
//         goto -> bb1;
//     }
//     bb20: {
//         return;
//     }
// }
// END rustc.main.mir_map.0.mir