2023-07-18 13:18:17 -05:00
|
|
|
// Verify that optimized MIR only copies `a` once.
|
|
|
|
//@ compile-flags: -O -C no-prepopulate-passes
|
2023-01-09 19:56:38 -06:00
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
|
|
|
|
type T = [u8; 256];
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
pub fn f(a: T, b: fn(_: T, _: T)) {
|
2023-07-27 16:44:13 -05:00
|
|
|
// 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)
|
2023-01-09 19:56:38 -06:00
|
|
|
b(a, a)
|
|
|
|
}
|