Add FileCheck to calls.rs

This commit is contained in:
Shunpoco
2025-01-04 11:18:40 +00:00
parent e36689aea7
commit 3b1e20ce5d
+12 -1
View File
@@ -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;
{