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
10 changes: 9 additions & 1 deletion tests/mir-opt/copy-prop/calls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// skip-filecheck
// Check that CopyProp does propagate return values of call terminators.
//@ test-mir-pass: CopyProp
//@ needs-unwind
Expand All @@ -13,13 +12,22 @@ fn dummy(x: u8) -> u8 {

// EMIT_MIR calls.nrvo.CopyProp.diff
fn nrvo() -> u8 {
// CHECK-LABEL: fn nrvo(
// CHECK: debug y => _0;
// CHECK-NOT: StorageLive(_1);
// CHECK-NOT: _1 = dummy(const 5_u8)
// CHECK-NOT: _0 = copy _1;
// CHECK-NOT: StorageDead(_1);
let y = dummy(5); // this should get NRVO
y
}

// EMIT_MIR calls.multiple_edges.CopyProp.diff
#[custom_mir(dialect = "runtime", phase = "initial")]
fn multiple_edges(t: bool) -> u8 {
// CHECK-LABEL: fn multiple_edges(
// CHECK: bb2: {
// CHECK: _0 = copy _2;
mir! {
let x: u8;
{
Expand Down