Skip to content

Add FileCheck annotations to mir-opt/copy-prop #135099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
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