There was an error while loading. Please reload this page.
1 parent a59a8f9 commit 5f575bcCopy full SHA for 5f575bc
1 file changed
tests/codegen/slice-init.rs
@@ -89,6 +89,20 @@ pub fn option_none_init() -> [Option<u8>; N] {
89
[None;N]
90
}
91
92
+use std::mem::MaybeUninit;
93
+
94
+// FIXME: This could be optimized into a memset.
95
+// Regression test for <https://github.com/rust-lang/rust/issues/137892>.
96
+#[no_mangle]
97
+pubfnhalf_uninit() -> [(u128,MaybeUninit<u128>);N]{
98
+// CHECK-NOT: select
99
+// CHECK: br label %repeat_loop_header{{.*}}
100
+// CHECK-NOT: switch
101
+// CHECK: icmp
102
+// CHECK-NOT: call void @llvm.memset.p0
103
+[const{(0,MaybeUninit::uninit())};N]
104
+}
105
106
// Use an opaque function to prevent rustc from removing useless drops.
107
#[inline(never)]
108
pubfnopaque(_:implSized){}
0 commit comments