about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-02-23 09:25:34 +0100
committerGitHub <noreply@github.com>2019-02-23 09:25:34 +0100
commitc2ad75e36409c97a49c950060d88c4ca7eaa580c (patch)
treec09e72c2e6d4584d418c7076dad54daf5c8b4b07
parent69cb908849958f803a2c3cf072573d3d8dadda0e (diff)
parentb72ba0559cab28ab88c9397ece9e5e4b193bdc89 (diff)
downloadrust-c2ad75e36409c97a49c950060d88c4ca7eaa580c.tar.gz
rust-c2ad75e36409c97a49c950060d88c4ca7eaa580c.zip
Rollup merge of #58648 - pnkfelix:issue-23926-update-tests, r=nikomatsakis
Update tests to account for cross-platform testing and miri.

Fix #23926
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3.rs9
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3b.rs10
-rw-r--r--src/test/ui/huge-array-simple.rs13
-rw-r--r--src/test/ui/huge-array-simple.stderr4
4 files changed, 24 insertions, 12 deletions
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3.rs b/src/test/ui/consts/const-eval/const-eval-overflow-3.rs
index 95deb04fb01..6fd8e9cbc80 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-3.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-3.rs
@@ -3,11 +3,11 @@
 //
 // This test is checking the count in an array expression.
 
-// FIXME (#23926): the error output is not consistent between a
-// self-hosted and a cross-compiled setup; therefore resorting to
-// error-pattern for now.
 
-// error-pattern: attempt to add with overflow
+
+
+
+
 
 #![allow(unused_imports)]
 
@@ -18,6 +18,7 @@ use std::{u8, u16, u32, u64, usize};
 const A_I8_I
     : [u32; (i8::MAX as usize) + 1]
     = [0; (i8::MAX + 1) as usize];
+//~^ ERROR evaluation of constant value failed
 
 fn main() {
     foo(&A_I8_I[..]);
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3b.rs b/src/test/ui/consts/const-eval/const-eval-overflow-3b.rs
index 5a6be0c9bd3..d9b06370dff 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-3b.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-3b.rs
@@ -7,11 +7,11 @@
 // types for the left- and right-hand sides of the addition do not
 // match (as well as overflow).
 
-// FIXME (#23926): the error output is not consistent between a
-// self-hosted and a cross-compiled setup; therefore resorting to
-// error-pattern for now.
 
-// error-pattern: mismatched types
+
+
+
+
 
 #![allow(unused_imports)]
 
@@ -22,6 +22,8 @@ use std::{u8, u16, u32, u64, usize};
 const A_I8_I
     : [u32; (i8::MAX as usize) + 1]
     = [0; (i8::MAX + 1u8) as usize];
+//~^ ERROR mismatched types
+//~| ERROR cannot add `u8` to `i8`
 
 fn main() {
     foo(&A_I8_I[..]);
diff --git a/src/test/ui/huge-array-simple.rs b/src/test/ui/huge-array-simple.rs
index 5fa874c1fa0..8b244a47232 100644
--- a/src/test/ui/huge-array-simple.rs
+++ b/src/test/ui/huge-array-simple.rs
@@ -1,11 +1,16 @@
-// FIXME (#23926): the error output is not consistent between a
-// self-hosted and a cross-compiled setup. Skipping for now.
-
-// ignore-test FIXME(#23926)
+// error-pattern: too big for the current architecture
 
+// normalize-stderr-test "; \d+]" -> "; N]"
 #![allow(exceeding_bitshifts)]
 
+#[cfg(target_pointer_width = "64")]
 fn main() {
     let _fat : [u8; (1<<61)+(1<<31)] =
         [0; (1u64<<61) as usize +(1u64<<31) as usize];
 }
+
+#[cfg(target_pointer_width = "32")]
+fn main() {
+    let _fat : [u8; (1<<31)+(1<<15)] =
+        [0; (1u32<<31) as usize +(1u32<<15) as usize];
+}
diff --git a/src/test/ui/huge-array-simple.stderr b/src/test/ui/huge-array-simple.stderr
new file mode 100644
index 00000000000..3e9c86296ce
--- /dev/null
+++ b/src/test/ui/huge-array-simple.stderr
@@ -0,0 +1,4 @@
+error: the type `[u8; N]` is too big for the current architecture
+
+error: aborting due to previous error
+