Skip to content

Commit ff260c8

Browse files
committed
Add FileCheck to cycle.rs
1 parent 17b0d90 commit ff260c8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// skip-filecheck
21
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
32
//! Tests that cyclic assignments don't hang CopyProp, and result in reasonable code.
43
//@ test-mir-pass: CopyProp
@@ -8,6 +7,18 @@ fn val() -> i32 {
87

98
// EMIT_MIR cycle.main.CopyProp.diff
109
fn main() {
10+
// CHECK-LABEL: fn main(
11+
// CHECK: debug x => [[x:_.*]];
12+
// CHECK: debug y => [[y:_.*]];
13+
// CHECK: debug z => [[y]];
14+
// CHECK-NOT: StorageLive([[y]]);
15+
// CHECK: [[y]] = copy [[x]];
16+
// CHECK-NOT: StorageLive(_3);
17+
// CHECK-NOT: _3 = copy [[y]];
18+
// CHECK-NOT: StorageLive(_4);
19+
// CHECK-NOT: _4 = copy _3;
20+
// CHECK-NOT: _1 = move _4;
21+
// CHECK: [[x]] = copy [[y]];
1122
let mut x = val();
1223
let y = x;
1324
let z = y;

0 commit comments

Comments
 (0)