about summary refs log tree commit diff
path: root/src/test/codegen
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-04 09:41:43 +0000
committerbors <bors@rust-lang.org>2023-01-04 09:41:43 +0000
commit5c18bc6137256693e604a701b7d1bf10e93aaa2d (patch)
tree8d778b9253efbb7c9bc9fdf823a2097b781c55f7 /src/test/codegen
parentddad1e1f15f77074738bb3d7fb7688a9177b6450 (diff)
parent4e590b3ee9622c90814c656e784e2facd5bc21ca (diff)
downloadrust-5c18bc6137256693e604a701b7d1bf10e93aaa2d.tar.gz
rust-5c18bc6137256693e604a701b7d1bf10e93aaa2d.zip
Auto merge of #106442 - matthiaskrgr:rollup-wivf7gh, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #106200 (Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions)
 - #106274 (Add JSON output to -Zdump-mono-stats)
 - #106292 (Add codegen test for `Box::new(uninit)` of big arrays)
 - #106327 (Add tidy check for dbg)
 - #106361 (Note maximum integer literal for `IntLiteralTooLarge`)
 - #106396 (Allow passing a specific date to `bump-stage0`)
 - #106436 (Enable doctests for rustc_query_impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/codegen')
-rw-r--r--src/test/codegen/box-maybe-uninit-llvm14.rs14
-rw-r--r--src/test/codegen/box-maybe-uninit.rs14
2 files changed, 22 insertions, 6 deletions
diff --git a/src/test/codegen/box-maybe-uninit-llvm14.rs b/src/test/codegen/box-maybe-uninit-llvm14.rs
index bd1a6599c33..7b5ae894311 100644
--- a/src/test/codegen/box-maybe-uninit-llvm14.rs
+++ b/src/test/codegen/box-maybe-uninit-llvm14.rs
@@ -2,7 +2,7 @@
 
 // Once we're done with llvm 14 and earlier, this test can be deleted.
 
-#![crate_type="lib"]
+#![crate_type = "lib"]
 
 use std::mem::MaybeUninit;
 
@@ -17,8 +17,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
     Box::new(MaybeUninit::uninit())
 }
 
-// FIXME: add a test for a bigger box. Currently broken, see
-// https://github.com/rust-lang/rust/issues/58201.
+// https://github.com/rust-lang/rust/issues/58201
+#[no_mangle]
+pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
+    // CHECK-LABEL: @box_uninitialized2
+    // CHECK-NOT: store
+    // CHECK-NOT: alloca
+    // CHECK-NOT: memcpy
+    // CHECK-NOT: memset
+    Box::new(MaybeUninit::uninit())
+}
 
 // Hide the LLVM 15+ `allocalign` attribute in the declaration of __rust_alloc
 // from the CHECK-NOT above. We don't check the attributes here because we can't rely
diff --git a/src/test/codegen/box-maybe-uninit.rs b/src/test/codegen/box-maybe-uninit.rs
index e105e26f16a..c82b56a71f5 100644
--- a/src/test/codegen/box-maybe-uninit.rs
+++ b/src/test/codegen/box-maybe-uninit.rs
@@ -1,6 +1,6 @@
 // compile-flags: -O
 // min-llvm-version: 15.0
-#![crate_type="lib"]
+#![crate_type = "lib"]
 
 use std::mem::MaybeUninit;
 
@@ -15,8 +15,16 @@ pub fn box_uninitialized() -> Box<MaybeUninit<usize>> {
     Box::new(MaybeUninit::uninit())
 }
 
-// FIXME: add a test for a bigger box. Currently broken, see
-// https://github.com/rust-lang/rust/issues/58201.
+// https://github.com/rust-lang/rust/issues/58201
+#[no_mangle]
+pub fn box_uninitialized2() -> Box<MaybeUninit<[usize; 1024 * 1024]>> {
+    // CHECK-LABEL: @box_uninitialized2
+    // CHECK-NOT: store
+    // CHECK-NOT: alloca
+    // CHECK-NOT: memcpy
+    // CHECK-NOT: memset
+    Box::new(MaybeUninit::uninit())
+}
 
 // Hide the `allocalign` attribute in the declaration of __rust_alloc
 // from the CHECK-NOT above, and also verify the attributes got set reasonably.