Skip to content

Commit 7a64137

Browse files
committed
address review: add CHECKs for baz in copy_propagation_arg.rs
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
1 parent 6eab7c7 commit 7a64137

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ fn bar(mut x: u8) {
3232
fn baz(mut x: i32) -> i32 {
3333
// CHECK-LABEL: fn baz(
3434
// CHECK: debug x => [[x:_.*]];
35+
// CHECK: [[x2:_.*]] = copy [[x]];
36+
// CHECK: [[x]] = move [[x2]];
3537
// CHECK: _0 = copy [[x]];
36-
// self-assignment to a function argument should be eliminated
38+
// In the original case for DestProp, the self-assignment to a function argument is eliminated,
39+
// but in CopyProp it is not eliminated.
3740
x = x;
3841
x
3942
}

0 commit comments

Comments
 (0)