File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 22
33// Once we're done with llvm 14 and earlier, this test can be deleted.
44
5- #![ crate_type= "lib" ]
5+ #![ crate_type = "lib" ]
66
77use std:: mem:: MaybeUninit ;
88
@@ -17,8 +17,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
1717 Box :: new ( MaybeUninit :: uninit ( ) )
1818}
1919
20- // FIXME: add a test for a bigger box. Currently broken, see
21- // https://github.com/rust-lang/rust/issues/58201.
20+ // https://github.com/rust-lang/rust/issues/58201
21+ #[ no_mangle]
22+ pub fn box_uninitialized2 ( ) -> Box < MaybeUninit < [ usize ; 1024 * 1024 ] > > {
23+ // CHECK-LABEL: @box_uninitialized2
24+ // CHECK-NOT: store
25+ // CHECK-NOT: alloca
26+ // CHECK-NOT: memcpy
27+ // CHECK-NOT: memset
28+ Box :: new ( MaybeUninit :: uninit ( ) )
29+ }
2230
2331// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
2432// from the CHECK-NOT above. We don't check the attributes here because we can't rely
Original file line number Diff line number Diff line change 11// compile-flags: -O
22// min-llvm-version: 15.0
3- #![ crate_type= "lib" ]
3+ #![ crate_type = "lib" ]
44
55use std:: mem:: MaybeUninit ;
66
@@ -15,8 +15,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
1515 Box :: new ( MaybeUninit :: uninit ( ) )
1616}
1717
18- // FIXME: add a test for a bigger box. Currently broken, see
19- // https://github.com/rust-lang/rust/issues/58201.
18+ // https://github.com/rust-lang/rust/issues/58201
19+ #[ no_mangle]
20+ pub fn box_uninitialized2 ( ) -> Box < MaybeUninit < [ usize ; 1024 * 1024 ] > > {
21+ // CHECK-LABEL: @box_uninitialized2
22+ // CHECK-NOT: store
23+ // CHECK-NOT: alloca
24+ // CHECK-NOT: memcpy
25+ // CHECK-NOT: memset
26+ Box :: new ( MaybeUninit :: uninit ( ) )
27+ }
2028
2129// Hide the `allocalign` attribute in the declaration of __rust_alloc
2230// from the CHECK-NOT above, and also verify the attributes got set reasonably.
You can’t perform that action at this time.
0 commit comments