diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-01-09 20:56:38 -0500 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-01-11 10:27:06 -0500 |
| commit | 13eec69e1c192afcac098c8c332a4cc9990b2c1c (patch) | |
| tree | d5dfd04cdca30baa40fee9a0530db4c7171c9dfe | |
| parent | b22c152958eade17a71d899b29a2d39bcc77aa48 (diff) | |
| download | rust-13eec69e1c192afcac098c8c332a4cc9990b2c1c.tar.gz rust-13eec69e1c192afcac098c8c332a4cc9990b2c1c.zip | |
Add a regression test for argument copies with DestinationPropagation
| -rw-r--r-- | tests/codegen/move-operands.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/codegen/move-operands.rs b/tests/codegen/move-operands.rs new file mode 100644 index 00000000000..6c51324a312 --- /dev/null +++ b/tests/codegen/move-operands.rs @@ -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) +} |
