2023-04-05 03:44:20 -05:00
|
|
|
// ignore-wasm32 compiled with panic=abort by default
|
2020-05-24 14:37:09 -05:00
|
|
|
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
|
2022-04-24 16:34:24 -05:00
|
|
|
// unit-test: DestinationPropagation
|
2020-05-24 14:37:09 -05:00
|
|
|
fn val() -> i32 {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
|
2020-09-12 08:10:51 -05:00
|
|
|
// EMIT_MIR cycle.main.DestinationPropagation.diff
|
2020-05-24 14:37:09 -05:00
|
|
|
fn main() {
|
|
|
|
let mut x = val();
|
|
|
|
let y = x;
|
|
|
|
let z = y;
|
|
|
|
x = z;
|
|
|
|
|
|
|
|
drop(x);
|
|
|
|
}
|