3 // Once we're done with llvm 14 and earlier, this test can be deleted.
7 use std::mem::MaybeUninit;
9 // Boxing a `MaybeUninit` value should not copy junk from the stack
11 pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
12 // CHECK-LABEL: @box_uninitialized
17 Box::new(MaybeUninit::uninit())
20 // FIXME: add a test for a bigger box. Currently broken, see
21 // https://github.com/rust-lang/rust/issues/58201.
23 // Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
24 // from the CHECK-NOT above. We don't check the attributes here because we can't rely
25 // on all of them being set until LLVM 15.
26 // CHECK: declare noalias{{.*}} @__rust_alloc(i{{[0-9]+}}, i{{[0-9]+.*}})