mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
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: https://github.com/rust-lang/rust/pull/105813#issuecomment-1367947793 r? `@tmiasko`
This commit is contained in:
commit
1e4f90061c
12
tests/codegen/move-operands.rs
Normal file
12
tests/codegen/move-operands.rs
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user