From 8da9d23e5e7a509e8bee4e0a4b12b9e694a6f225 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 22 Aug 2020 18:03:34 +0200 Subject: [PATCH 1/2] tweak test matrix: test big-endian, and test less on macOS host (it is slow) --- ci.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci.sh b/ci.sh index ac0d080a4839..c2c36e1efc1f 100755 --- a/ci.sh +++ b/ci.sh @@ -43,9 +43,8 @@ if [ "${TRAVIS_OS_NAME:-}" == linux ]; then MIRI_TEST_TARGET=x86_64-apple-darwin run_tests MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests elif [ "${TRAVIS_OS_NAME:-}" == osx ]; then - MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests + MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests - MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests elif [ "${CI_WINDOWS:-}" == True ]; then MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests MIRI_TEST_TARGET=x86_64-apple-darwin run_tests From df9b2127ce5c8ac567f0dc60e3b7b828e10d5613 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 22 Aug 2020 18:07:43 +0200 Subject: [PATCH 2/2] fix a test for big-endian targets --- tests/run-pass/transmute_fat2.rs | 8 ++++++-- tests/run-pass/transmute_fat2.stderr | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/run-pass/transmute_fat2.rs b/tests/run-pass/transmute_fat2.rs index 3dff2cc1e0c9..2f0271d5813f 100644 --- a/tests/run-pass/transmute_fat2.rs +++ b/tests/run-pass/transmute_fat2.rs @@ -1,9 +1,13 @@ fn main() { - #[cfg(target_pointer_width="64")] + #[cfg(all(target_endian="little", target_pointer_width="64"))] let bad = unsafe { std::mem::transmute::(42) }; - #[cfg(target_pointer_width="32")] + #[cfg(all(target_endian="big", target_pointer_width="64"))] + let bad = unsafe { + std::mem::transmute::(42 << 64) + }; + #[cfg(all(target_endian="little", target_pointer_width="32"))] let bad = unsafe { std::mem::transmute::(42) }; diff --git a/tests/run-pass/transmute_fat2.stderr b/tests/run-pass/transmute_fat2.stderr index 08849a5b517a..c8298a6c23c6 100644 --- a/tests/run-pass/transmute_fat2.stderr +++ b/tests/run-pass/transmute_fat2.stderr @@ -1 +1 @@ -thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', $DIR/transmute_fat2.rs:11:5 +thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', $DIR/transmute_fat2.rs:15:5