Skip to content

Commit 1e4f900

Browse files
committed
Auto merge of #106660 - saethlin:destprop-move-codegen, r=tmiasko
Add a regression test for argument copies with DestinationPropagation This example, as a codegen test: #105813 (comment) r? `@tmiasko`
2 parents ef4046e + 13eec69 commit 1e4f900

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/codegen/move-operands.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// compile-flags: -C no-prepopulate-passes -Zmir-enable-passes=+DestinationPropagation
2+
3+
#![crate_type = "lib"]
4+
5+
type T = [u8; 256];
6+
7+
#[no_mangle]
8+
pub fn f(a: T, b: fn(_: T, _: T)) {
9+
// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
10+
// CHECK-NOT: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
11+
b(a, a)
12+
}

0 commit comments

Comments
 (0)