rust/tests/mir-opt/dest-prop/cycle.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
361 B
Rust
Raw Normal View History

// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
2020-05-24 19:37:09 +00:00
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
// unit-test: DestinationPropagation
2020-05-24 19:37:09 +00:00
fn val() -> i32 {
1
}
2020-09-12 13:10:51 +00:00
// EMIT_MIR cycle.main.DestinationPropagation.diff
2020-05-24 19:37:09 +00:00
fn main() {
let mut x = val();
let y = x;
let z = y;
x = z;
drop(x);
}