File tree 2 files changed +22
-6
lines changed
2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
// Once we're done with llvm 14 and earlier, this test can be deleted.
4
4
5
- #![ crate_type= "lib" ]
5
+ #![ crate_type = "lib" ]
6
6
7
7
use std:: mem:: MaybeUninit ;
8
8
@@ -17,8 +17,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
17
17
Box :: new ( MaybeUninit :: uninit ( ) )
18
18
}
19
19
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
+ }
22
30
23
31
// Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
24
32
// 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 1
1
// compile-flags: -O
2
2
// min-llvm-version: 15.0
3
- #![ crate_type= "lib" ]
3
+ #![ crate_type = "lib" ]
4
4
5
5
use std:: mem:: MaybeUninit ;
6
6
@@ -15,8 +15,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
15
15
Box :: new ( MaybeUninit :: uninit ( ) )
16
16
}
17
17
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
+ }
20
28
21
29
// Hide the `allocalign` attribute in the declaration of __rust_alloc
22
30
// 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