add codegen test for array::repeat

This commit is contained in:
joboet 2024-01-05 12:43:01 +01:00
parent 39a918002e
commit 1a8b0d7c53
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C

View File

@ -0,0 +1,15 @@
// 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)
}