File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 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,35 @@ fn dummy(x: u8) -> u8 {
98
109// EMIT_MIR copy_propagation_arg.foo.DestinationPropagation.diff
1110fn foo ( mut x : u8 ) {
11+ // CHECK: 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
1718fn bar ( mut x : u8 ) {
19+ // CHECK: bar
20+ // CHECK-NOT: {{_.*}} = {{_.*}}
1821 dummy ( x) ;
1922 x = 5 ;
2023}
2124
2225// EMIT_MIR copy_propagation_arg.baz.DestinationPropagation.diff
2326fn baz ( mut x : i32 ) -> i32 {
27+ // CHECK: baz
28+ // CHECK: {{_.*}} = {{_.*}}
29+ // CHECK-NOT: {{_.*}} = {{_.*}}
2430 // self-assignment to a function argument should be eliminated
2531 x = x;
2632 x
2733}
2834
2935// EMIT_MIR copy_propagation_arg.arg_src.DestinationPropagation.diff
3036fn arg_src ( mut x : i32 ) -> i32 {
37+ // CHECK: arg_src
38+ // CHECK: {{_.*}} = {{_.*}}
39+ // CHECK-NOT: {{_.*}} = {{_.*}}
3140 let y = x;
3241 x = 123 ; // Don't propagate this assignment to `y`
3342 y
You can’t perform that action at this time.
0 commit comments