]> git.lizzy.rs Git - rust.git/blob - tests/codegen/issue-96274.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / codegen / issue-96274.rs
1 // min-llvm-version: 15.0
2 // compile-flags: -O
3
4 #![crate_type = "lib"]
5 #![feature(inline_const)]
6
7 use std::mem::MaybeUninit;
8
9 pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
10     // CHECK-NOT: memset
11     [MaybeUninit::uninit(); 3000]
12 }
13
14 pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
15     // CHECK-NOT: memset
16     [const { MaybeUninit::uninit() }; 8192]
17 }