]> git.proxmox.com Git - rustc.git/blame - src/test/mir-opt/storage_ranges.rs
New upstream version 1.13.0+dfsg1
[rustc.git] / src / test / mir-opt / storage_ranges.rs
CommitLineData
5bcae85e
SL
1// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
9e0c209e
SL
11// ignore-tidy-linelength
12
5bcae85e
SL
13fn main() {
14 let a = 0;
15 {
16 let b = &Some(a);
17 }
18 let c = 1;
19}
20
21// END RUST SOURCE
9e0c209e 22// START rustc.node4.TypeckMir.before.mir
5bcae85e 23// bb0: {
9e0c209e
SL
24// StorageLive(var0); // scope 0 at storage_ranges.rs:14:9: 14:10
25// var0 = const 0i32; // scope 0 at storage_ranges.rs:14:13: 14:14
26// StorageLive(var1); // scope 1 at storage_ranges.rs:16:13: 16:14
27// StorageLive(tmp1); // scope 1 at storage_ranges.rs:16:18: 16:25
28// StorageLive(tmp2); // scope 1 at storage_ranges.rs:16:23: 16:24
29// tmp2 = var0; // scope 1 at storage_ranges.rs:16:23: 16:24
30// tmp1 = std::option::Option<i32>::Some(tmp2,); // scope 1 at storage_ranges.rs:16:18: 16:25
31// var1 = &tmp1; // scope 1 at storage_ranges.rs:16:17: 16:25
32// StorageDead(tmp2); // scope 1 at storage_ranges.rs:16:23: 16:24
33// tmp0 = (); // scope 2 at storage_ranges.rs:15:5: 17:6
34// StorageDead(tmp1); // scope 1 at storage_ranges.rs:16:18: 16:25
35// StorageDead(var1); // scope 1 at storage_ranges.rs:16:13: 16:14
36// StorageLive(var2); // scope 1 at storage_ranges.rs:18:9: 18:10
37// var2 = const 1i32; // scope 1 at storage_ranges.rs:18:13: 18:14
38// return = (); // scope 3 at storage_ranges.rs:13:11: 19:2
39// StorageDead(var2); // scope 1 at storage_ranges.rs:18:9: 18:10
40// StorageDead(var0); // scope 0 at storage_ranges.rs:14:9: 14:10
41// goto -> bb1; // scope 0 at storage_ranges.rs:13:1: 19:2
5bcae85e
SL
42// }
43//
44// bb1: {
9e0c209e 45// return; // scope 0 at storage_ranges.rs:13:1: 19:2
5bcae85e 46// }
9e0c209e 47// END rustc.node4.TypeckMir.before.mir