Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion tests/mir-opt/copy-prop/cycle.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//! Tests that cyclic assignments don't hang CopyProp, and result in reasonable code.
//@ test-mir-pass: CopyProp
Expand All @@ -8,6 +7,16 @@ fn val() -> i32 {

// EMIT_MIR cycle.main.CopyProp.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: debug z => _2;
// CHECK-NOT: StorageLive(_2);
// CHECK: _2 = copy _1;
// CHECK-NOT: StorageLive(_3);
// CHECK-NOT: _3 = copy _2;
// CHECK-NOT: StorageLive(_4);
// CHECK-NOT: _4 = copy _3;
// CHECK-NOT: _1 = move _4;
// CHECK: _1 = copy _2;
let mut x = val();
let y = x;
let z = y;
Expand Down