about summary refs log tree commit diff
path: root/tests/codegen-llvm/array-repeat.rs
diff options
context:
space:
mode:
authorTshepang Mbambo <hopsi@tuta.io>2025-07-25 05:36:15 +0200
committerGitHub <noreply@github.com>2025-07-25 05:36:15 +0200
commite69303f372a6d810e02b2c3cb9c3daf9198edde4 (patch)
treef1eb971f65244cd1e6781c87b5c81de8c18a47b8 /tests/codegen-llvm/array-repeat.rs
parent1ecb68d48c2cd1a8c02cd7506274aae31e57c13e (diff)
parente5b1e7d192780463c35d3a08ad79c6764119297e (diff)
downloadrust-e69303f372a6d810e02b2c3cb9c3daf9198edde4.tar.gz
rust-e69303f372a6d810e02b2c3cb9c3daf9198edde4.zip
Merge pull request #2518 from rust-lang/rustc-pull
Rustc pull update
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)
+}