about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2014-10-17 12:37:27 +0300
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2014-10-17 12:37:27 +0300
commit3ce5a9539fc7c20cf6a228bfc7d7fde03b9c6b93 (patch)
tree2d0a90e3355a1bae9c70122328650b14cc30057d
parent50db061173a2a54a9897e2d42f88b95d2b820cc4 (diff)
downloadrust-3ce5a9539fc7c20cf6a228bfc7d7fde03b9c6b93.tar.gz
rust-3ce5a9539fc7c20cf6a228bfc7d7fde03b9c6b93.zip
Make the tests green as they should on 32-bit architectures
On 32-bit architectures, the size calculations on two of the tests wrap-around
in typeck, which gives the relevant arrays a size of 0, which is (correctly)
successfully allocated.
-rw-r--r--src/test/compile-fail/huge-array-simple.rs2
-rw-r--r--src/test/compile-fail/issue-17913.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/test/compile-fail/huge-array-simple.rs b/src/test/compile-fail/huge-array-simple.rs
index badaa4b922f..b23d0716e6d 100644
--- a/src/test/compile-fail/huge-array-simple.rs
+++ b/src/test/compile-fail/huge-array-simple.rs
@@ -11,5 +11,5 @@
 // error-pattern: too big for the current
 
 fn main() {
-   let fat : [u8, ..1<<61] = [0, ..1<<61];
+   let fat : [u8, ..(1<<61)+(1<<31)] = [0, ..(1<<61)+(1<<31)];
 }
diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/compile-fail/issue-17913.rs
index 7baab03c119..037674aaa07 100644
--- a/src/test/compile-fail/issue-17913.rs
+++ b/src/test/compile-fail/issue-17913.rs
@@ -10,8 +10,16 @@
 
 // error-pattern: too big for the current architecture
 
+#[cfg(target_word_size = "64")]
 fn main() {
     let n = 0u;
     let a = box [&n,..0xF000000000000000u];
     println!("{}", a[0xFFFFFFu]);
 }
+ 
+#[cfg(target_word_size = "32")]
+fn main() {
+    let n = 0u;
+    let a = box [&n,..0xFFFFFFFFu];
+    println!("{}", a[0xFFFFFFu]);
+}