From 3b1e20ce5d40640f35adb0f6714f5ced3a4b7288 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Sat, 4 Jan 2025 11:18:40 +0000 Subject: [PATCH] Add FileCheck to calls.rs --- tests/mir-opt/copy-prop/calls.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/mir-opt/copy-prop/calls.rs b/tests/mir-opt/copy-prop/calls.rs index 8937c0d2ecb2..f19b114523d3 100644 --- a/tests/mir-opt/copy-prop/calls.rs +++ b/tests/mir-opt/copy-prop/calls.rs @@ -1,4 +1,3 @@ -// skip-filecheck // Check that CopyProp does propagate return values of call terminators. //@ test-mir-pass: CopyProp //@ needs-unwind @@ -13,6 +12,13 @@ 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: _0 = dummy(const 5_u8) + // CHECK-NOT: _0 = copy _1; + // CHECK-NOT: StorageDead(_1); let y = dummy(5); // this should get NRVO y } @@ -20,6 +26,11 @@ fn nrvo() -> u8 { // 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: bb1: { + // CHECK: _2 = dummy(const 13_u8) + // CHECK: bb2: { + // CHECK: _0 = copy _2; mir! { let x: u8; {