mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
14 lines
427 B
Rust
14 lines
427 B
Rust
// Verify that optimized MIR only copies `a` once.
|
|
//@ compile-flags: -O -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)
|
|
}
|