about summary refs log tree commit diff
path: root/tests/codegen/issues/issue-96274.rs
blob: 2425ec53e4e1942e5e577fb803735276b7ea2536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

use std::mem::MaybeUninit;

pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
    // CHECK-NOT: memset
    [MaybeUninit::uninit(); 3000]
}

pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
    // CHECK-NOT: memset
    [const { MaybeUninit::uninit() }; 8192]
}