about summary refs log tree commit diff
path: root/tests/codegen-llvm/move-operands.rs
blob: ddad231b762cda375fabd712f004788d5d045228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Verify that optimized MIR only copies `a` once.
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes

#![crate_type = "lib"]

type T = [u8; 256];

#[no_mangle]
pub fn f(a: T, b: fn(_: T, _: T)) {
    // CHECK: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, {{.*}} 256, i1 false)
    // CHECK-NOT: call void @llvm.memcpy.{{.*}}(ptr align 1 %{{.*}}, ptr align 1 %{{.*}}, {{.*}} 256, i1 false)
    b(a, a)
}