Skip to content

Commit 3b1e20c

Browse files
committed
Add FileCheck to calls.rs
1 parent e36689a commit 3b1e20c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/mir-opt/copy-prop/calls.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
// Check that CopyProp does propagate return values of call terminators.
32
//@ test-mir-pass: CopyProp
43
//@ needs-unwind
@@ -13,13 +12,25 @@ fn dummy(x: u8) -> u8 {
1312

1413
// EMIT_MIR calls.nrvo.CopyProp.diff
1514
fn nrvo() -> u8 {
15+
// CHECK-LABEL: fn nrvo(
16+
// CHECK: debug y => _0;
17+
// CHECK-NOT: StorageLive(_1);
18+
// CHECK-NOT: _1 = dummy(const 5_u8)
19+
// CHECK: _0 = dummy(const 5_u8)
20+
// CHECK-NOT: _0 = copy _1;
21+
// CHECK-NOT: StorageDead(_1);
1622
let y = dummy(5); // this should get NRVO
1723
y
1824
}
1925

2026
// EMIT_MIR calls.multiple_edges.CopyProp.diff
2127
#[custom_mir(dialect = "runtime", phase = "initial")]
2228
fn multiple_edges(t: bool) -> u8 {
29+
// CHECK-LABEL: fn multiple_edges(
30+
// CHECK: bb1: {
31+
// CHECK: _2 = dummy(const 13_u8)
32+
// CHECK: bb2: {
33+
// CHECK: _0 = copy _2;
2334
mir! {
2435
let x: u8;
2536
{

0 commit comments

Comments
 (0)