Skip to content

Commit

Permalink
Rollup merge of rust-lang#58648 - pnkfelix:issue-23926-update-tests, …
Browse files Browse the repository at this point in the history
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
  • Loading branch information
Centril committed Feb 23, 2019
2 parents 69cb908 + b72ba05 commit c2ad75e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
9 changes: 5 additions & 4 deletions src/test/ui/consts/const-eval/const-eval-overflow-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand All @@ -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[..]);
Expand Down
10 changes: 6 additions & 4 deletions src/test/ui/consts/const-eval/const-eval-overflow-3b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Expand All @@ -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[..]);
Expand Down
13 changes: 9 additions & 4 deletions src/test/ui/huge-array-simple.rs
Original file line number Diff line number Diff line change
@@ -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];
}
4 changes: 4 additions & 0 deletions src/test/ui/huge-array-simple.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
error: the type `[u8; N]` is too big for the current architecture

error: aborting due to previous error

0 comments on commit c2ad75e

Please sign in to comment.