2023-06-08 02:18:34 -05:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2020-05-24 14:37:09 -05:00
|
|
|
//! Tests that cyclic assignments don't hang DestinationPropagation, and result in reasonable code.
|
2024-04-20 06:19:34 -05:00
|
|
|
//@ test-mir-pass: 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() {
|
2024-04-14 04:35:37 -05:00
|
|
|
// CHECK-LABEL: main(
|
|
|
|
// CHECK: debug x => [[x:_.*]];
|
|
|
|
// CHECK: [[x]] = val()
|
|
|
|
// CHECK-NOT: [[x]] = {{_.*}};
|
2020-05-24 14:37:09 -05:00
|
|
|
let mut x = val();
|
|
|
|
let y = x;
|
|
|
|
let z = y;
|
|
|
|
x = z;
|
|
|
|
|
|
|
|
drop(x);
|
|
|
|
}
|