about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-07-09 19:25:28 -0700
committerJubilee Young <workingjubilee@gmail.com>2024-09-19 16:23:38 -0700
commitf4cb6ef8d86cdf62f8f0c8f0b62395ae2616da26 (patch)
treed22111f8036410b6cf96c7414e309af4a751492b
parentd6383b4605856394ef839b82c9dec5c4d0b67e3c (diff)
downloadrust-f4cb6ef8d86cdf62f8f0c8f0b62395ae2616da26.tar.gz
rust-f4cb6ef8d86cdf62f8f0c8f0b62395ae2616da26.zip
Keep object-size-dependent tests failing
These tests depend on the internal logic of rustc regarding handling
very large objects. Fix them to reflect rustc_abi::obj_size_bound diffs.
-rw-r--r--tests/crashes/125476.rs2
-rw-r--r--tests/ui/extern/extern-static-size-overflow.rs30
-rw-r--r--tests/ui/extern/extern-static-size-overflow.stderr6
-rw-r--r--tests/ui/limits/huge-enum.rs2
4 files changed, 11 insertions, 29 deletions
diff --git a/tests/crashes/125476.rs b/tests/crashes/125476.rs
index aa9a081388d..ad739639b72 100644
--- a/tests/crashes/125476.rs
+++ b/tests/crashes/125476.rs
@@ -1,4 +1,4 @@
 //@ known-bug: rust-lang/rust#125476
 //@ only-x86_64
-pub struct Data([u8; usize::MAX >> 16]);
+pub struct Data([u8; usize::MAX >> 2]);
 const _: &'static [Data] = &[];
diff --git a/tests/ui/extern/extern-static-size-overflow.rs b/tests/ui/extern/extern-static-size-overflow.rs
index a96ce0cf47e..f33e482aa66 100644
--- a/tests/ui/extern/extern-static-size-overflow.rs
+++ b/tests/ui/extern/extern-static-size-overflow.rs
@@ -4,31 +4,13 @@ struct ReallyBig {
 }
 
 // The limit for "too big for the current architecture" is dependent on the target pointer size
-// however it's artificially limited on 64 bits
-// logic copied from rustc_target::abi::TargetDataLayout::obj_size_bound()
+// but is artificially limited due to LLVM's internal architecture
+// logic based on rustc_target::abi::TargetDataLayout::obj_size_bound()
 const fn max_size() -> usize {
-    #[cfg(target_pointer_width = "16")]
-    {
-        1 << 15
-    }
-
-    #[cfg(target_pointer_width = "32")]
-    {
-        1 << 31
-    }
-
-    #[cfg(target_pointer_width = "64")]
-    {
-        1 << 47
-    }
-
-    #[cfg(not(any(
-        target_pointer_width = "16",
-        target_pointer_width = "32",
-        target_pointer_width = "64"
-    )))]
-    {
-        isize::MAX as usize
+    if usize::BITS < 61 {
+        1 << (usize::BITS - 1)
+    } else {
+        1 << 61
     }
 }
 
diff --git a/tests/ui/extern/extern-static-size-overflow.stderr b/tests/ui/extern/extern-static-size-overflow.stderr
index 1c926399591..5da580e34f4 100644
--- a/tests/ui/extern/extern-static-size-overflow.stderr
+++ b/tests/ui/extern/extern-static-size-overflow.stderr
@@ -1,17 +1,17 @@
 error: extern static is too large for the current architecture
-  --> $DIR/extern-static-size-overflow.rs:38:5
+  --> $DIR/extern-static-size-overflow.rs:20:5
    |
 LL |     static BAZ: [u8; max_size()];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: extern static is too large for the current architecture
-  --> $DIR/extern-static-size-overflow.rs:39:5
+  --> $DIR/extern-static-size-overflow.rs:21:5
    |
 LL |     static UWU: [usize; usize::MAX];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: extern static is too large for the current architecture
-  --> $DIR/extern-static-size-overflow.rs:40:5
+  --> $DIR/extern-static-size-overflow.rs:22:5
    |
 LL |     static A: ReallyBig;
    |     ^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/limits/huge-enum.rs b/tests/ui/limits/huge-enum.rs
index cf6e637388c..031b342afb3 100644
--- a/tests/ui/limits/huge-enum.rs
+++ b/tests/ui/limits/huge-enum.rs
@@ -6,7 +6,7 @@
 type BIG = Option<[u32; (1<<29)-1]>;
 
 #[cfg(target_pointer_width = "64")]
-type BIG = Option<[u32; (1<<45)-1]>;
+type BIG = Option<[u32; (1<<59)-1]>;
 
 fn main() {
     let big: BIG = None;