Skip to content

Commit 1a8b0d7

Browse files
committed
add codegen test for array::repeat
1 parent 39a9180 commit 1a8b0d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/codegen/array-repeat.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-flags: -O
2+
3+
#![crate_type = "lib"]
4+
#![feature(array_repeat)]
5+
6+
use std::array::repeat;
7+
8+
// CHECK-LABEL: @byte_repeat
9+
#[no_mangle]
10+
fn byte_repeat(b: u8) -> [u8; 1024] {
11+
// CHECK-NOT: alloca
12+
// CHECK-NOT: store
13+
// CHECK: memset
14+
repeat(b)
15+
}

0 commit comments

Comments
 (0)