Skip to content

Commit

Permalink
Add a regression test for argument copies with DestinationPropagation
Browse files Browse the repository at this point in the history
  • Loading branch information
saethlin committed Jan 11, 2023
1 parent b22c152 commit 13eec69
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/codegen/move-operands.rs
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 13eec69

Please sign in to comment.