2016-12-11 21:54:54 +01:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
|
|
|
fn test(x: u32) -> u32 {
|
|
|
|
let y = x;
|
|
|
|
y
|
|
|
|
}
|
|
|
|
|
2017-10-30 18:20:07 +01:00
|
|
|
fn main() {
|
|
|
|
// Make sure the function actually gets instantiated.
|
|
|
|
test(0);
|
|
|
|
}
|
2016-12-11 21:54:54 +01:00
|
|
|
|
|
|
|
// END RUST SOURCE
|
2017-11-04 14:27:08 +03:00
|
|
|
// START rustc.test.CopyPropagation.before.mir
|
2016-12-11 21:54:54 +01:00
|
|
|
// bb0: {
|
2017-10-09 23:14:13 -04:00
|
|
|
// ...
|
2018-06-27 22:06:21 +01:00
|
|
|
// _2 = _1;
|
2017-10-09 23:14:13 -04:00
|
|
|
// ...
|
2018-06-27 22:06:21 +01:00
|
|
|
// _0 = _2;
|
2017-10-09 23:14:13 -04:00
|
|
|
// ...
|
2016-12-11 21:54:54 +01:00
|
|
|
// return;
|
|
|
|
// }
|
2017-11-04 14:27:08 +03:00
|
|
|
// END rustc.test.CopyPropagation.before.mir
|
|
|
|
// START rustc.test.CopyPropagation.after.mir
|
2016-12-11 21:54:54 +01:00
|
|
|
// bb0: {
|
2017-10-09 23:14:13 -04:00
|
|
|
// ...
|
2018-06-27 22:06:21 +01:00
|
|
|
// _0 = _1;
|
2017-10-09 23:14:13 -04:00
|
|
|
// ...
|
2016-12-11 21:54:54 +01:00
|
|
|
// return;
|
|
|
|
// }
|
2017-11-04 14:27:08 +03:00
|
|
|
// END rustc.test.CopyPropagation.after.mir
|