about summary refs log tree commit diff
path: root/tests/codegen-llvm/array-repeat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen-llvm/array-repeat.rs')
-rw-r--r--tests/codegen-llvm/array-repeat.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/codegen-llvm/array-repeat.rs b/tests/codegen-llvm/array-repeat.rs
new file mode 100644
index 00000000000..4c755df9390
--- /dev/null
+++ b/tests/codegen-llvm/array-repeat.rs
@@ -0,0 +1,15 @@
+//@ compile-flags: -Copt-level=3
+
+#![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)
+}