Add a regression test for argument copies with DestinationPropagation

This commit is contained in:
Ben Kimock 2023-01-09 20:56:38 -05:00
parent b22c152958
commit 13eec69e1c

View File

@ -0,0 +1,12 @@
// compile-flags: -C no-prepopulate-passes -Zmir-enable-passes=+DestinationPropagation
#![crate_type = "lib"]
type T = [u8; 256];
#[no_mangle]
pub fn f(a: T, b: fn(_: T, _: T)) {
// CHECK: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
// CHECK-NOT: call void @llvm.memcpy.{{.*}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %{{.*}}, {{.*}} 256, i1 false)
b(a, a)
}