mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
15 lines
249 B
Rust
15 lines
249 B
Rust
//@ compile-flags: -O
|
|
|
|
#![crate_type="rlib"]
|
|
|
|
// CHECK-LABEL: @memzero
|
|
// CHECK-NOT: store
|
|
// CHECK: call void @llvm.memset
|
|
// CHECK-NOT: store
|
|
#[no_mangle]
|
|
pub fn memzero(data: &mut [u8]) {
|
|
for i in 0..data.len() {
|
|
data[i] = 0;
|
|
}
|
|
}
|