rust/tests/codegen/array-repeat.rs
2024-06-19 17:48:05 +02:00

16 lines
264 B
Rust

//@ compile-flags: -O
#![crate_type = "lib"]
#![feature(array_repeat)]
use std::array::repeat;
// CHECK-LABEL: @byte_repeat
#[no_mangle]
fn byte_repeat(b: u8) -> [u8; 1024] {
// CHECK-NOT: alloca
// CHECK-NOT: store
// CHECK: memset
repeat(b)
}