File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 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
1514fn 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" ) ]
2228fn 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 {
You can’t perform that action at this time.
0 commit comments