mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-14 04:56:49 +00:00
Add a test
This commit is contained in:
parent
a59a8f9e75
commit
5f575bc4bc
@ -89,6 +89,20 @@ pub fn option_none_init() -> [Option<u8>; N] {
|
||||
[None; N]
|
||||
}
|
||||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
// FIXME: This could be optimized into a memset.
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/137892>.
|
||||
#[no_mangle]
|
||||
pub fn half_uninit() -> [(u128, MaybeUninit<u128>); N] {
|
||||
// CHECK-NOT: select
|
||||
// CHECK: br label %repeat_loop_header{{.*}}
|
||||
// CHECK-NOT: switch
|
||||
// CHECK: icmp
|
||||
// CHECK-NOT: call void @llvm.memset.p0
|
||||
[const { (0, MaybeUninit::uninit()) }; N]
|
||||
}
|
||||
|
||||
// Use an opaque function to prevent rustc from removing useless drops.
|
||||
#[inline(never)]
|
||||
pub fn opaque(_: impl Sized) {}
|
||||
|
Loading…
Reference in New Issue
Block a user