File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ compile-flags: -Copt-level=3 -Cdebuginfo=0
2+
3+ // This is a regression test for https://github.com/rust-lang/rust/issues/139355 as well as
4+ // regressions I introduced while implementing a solution.
5+
6+ #![ crate_type = "lib" ]
7+
8+ use std:: mem:: MaybeUninit ;
9+
10+ // CHECK-LABEL: @create_small_uninit_array
11+ #[ no_mangle]
12+ fn create_small_uninit_array ( ) -> [ MaybeUninit < u8 > ; 4 ] {
13+ // CHECK-NEXT: start:
14+ // CHECK-NEXT: ret i32 undef
15+ [ MaybeUninit :: < u8 > :: uninit ( ) ; 4 ]
16+ }
17+
18+ // CHECK-LABEL: @create_nested_uninit_array
19+ #[ no_mangle]
20+ fn create_nested_uninit_array ( ) -> [ [ MaybeUninit < u8 > ; 4 ] ; 100 ] {
21+ // CHECK-NEXT: start:
22+ // CHECK-NEXT: ret void
23+ [ [ MaybeUninit :: < u8 > :: uninit ( ) ; 4 ] ; 100 ]
24+ }
25+
26+ // CHECK-LABEL: @create_ptr
27+ #[ no_mangle]
28+ fn create_ptr ( ) -> MaybeUninit < & ' static str > {
29+ // CHECK-NEXT: start:
30+ // CHECK-NEXT: ret %{{.*}} undef
31+ MaybeUninit :: uninit ( )
32+ }
You can’t perform that action at this time.
0 commit comments