]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/nll/liveness-interblock.rs
Update the tools CI to use --no-fail-fast and --save-toolstates.
[rust.git] / src / test / mir-opt / nll / liveness-interblock.rs
1 // Copyright 2012-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
11 // compile-flags:-Znll
12
13 fn cond() -> bool { false }
14
15 fn make_live(_: usize) { }
16
17 fn make_dead() { }
18
19 fn main() {
20     let x = 5;
21
22     if cond() {
23         make_live(x);
24     } else {
25         // x should be dead on entry to this block
26         make_dead();
27     }
28 }
29
30 // END RUST SOURCE
31 // START rustc.main.nll.0.mir
32 //     | Live variables on entry to bb2: [_1]
33 //     bb2: {
34 //             | Live variables at bb2[0]: [_1]
35 //         StorageLive(_4);
36 //             | Live variables at bb2[1]: [_1]
37 //         _4 = _1;
38 //             | Live variables at bb2[2]: [_4]
39 //         _3 = const make_live(move _4) -> bb4;
40 //     }
41 // END rustc.main.nll.0.mir
42 // START rustc.main.nll.0.mir
43 //     | Live variables on entry to bb3: []
44 //     bb3: {
45 //             | Live variables at bb3[0]: []
46 //         _5 = const make_dead() -> bb5;
47 //     }
48 // END rustc.main.nll.0.mir
49
50