Skip to content

Commit df5e449

Browse files
committed
Run filecheck on copy_propagation.rs
1 parent 2dd949e commit df5e449

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/mir-opt/dest-prop/copy_propagation_arg.rs

Lines changed: 9 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
// Check that DestinationPropagation does not propagate an assignment to a function argument
43
// (doing so can break usages of the original argument value)
@@ -9,25 +8,34 @@ fn dummy(x: u8) -> u8 {
98

109
// EMIT_MIR copy_propagation_arg.foo.DestinationPropagation.diff
1110
fn foo(mut x: u8) {
11+
// CHECK-LABEL: foo
12+
// CHECK-NOT: {{_.*}} = {{_.*}}
1213
// calling `dummy` to make a use of `x` that copyprop cannot eliminate
1314
x = dummy(x); // this will assign a local to `x`
1415
}
1516

1617
// EMIT_MIR copy_propagation_arg.bar.DestinationPropagation.diff
1718
fn bar(mut x: u8) {
19+
// CHECK-LABEL: bar
20+
// CHECK-NOT: {{_.*}} = {{_.*}}
1821
dummy(x);
1922
x = 5;
2023
}
2124

2225
// EMIT_MIR copy_propagation_arg.baz.DestinationPropagation.diff
2326
fn baz(mut x: i32) -> i32 {
27+
// CHECK-LABEL: baz
28+
// CHECK-NOT: {{_.*}} = {{_.*}}
2429
// self-assignment to a function argument should be eliminated
2530
x = x;
2631
x
2732
}
2833

2934
// EMIT_MIR copy_propagation_arg.arg_src.DestinationPropagation.diff
3035
fn arg_src(mut x: i32) -> i32 {
36+
// CHECK-LABEL: baz
37+
// CHECK: {{_.*}} = {{_.*}}
38+
// CHECK-NOT: {{_.*}} = {{_.*}}
3139
let y = x;
3240
x = 123; // Don't propagate this assignment to `y`
3341
y

0 commit comments

Comments
 (0)