From 4f678509649a59daa17dc968b2aeb1023fb23c0f Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 17 Apr 2015 02:03:38 +0200 Subject: [PATCH] Fix test for 32-bit targets. (The cast from the 64-bit value to isize was using the lower 32-bits, which led to it being treated as a large positive value rather than a smallish negative one. The fix was to use the same bits for the upper- and lower- 32 bits.) --- src/test/run-pass/wrapping-int-api.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/run-pass/wrapping-int-api.rs b/src/test/run-pass/wrapping-int-api.rs index 5d1d6919f52..e195d624fe5 100644 --- a/src/test/run-pass/wrapping-int-api.rs +++ b/src/test/run-pass/wrapping-int-api.rs @@ -101,13 +101,13 @@ fn main() { check_mul_no_wrap!(0xfedc_u16 as i16, -2); check_mul_no_wrap!(0xfedc_ba98_u32 as i32, -2); check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as i64, -2); - check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as u64 as isize, -2); + check_mul_no_wrap!(0xfedc_ba98_fedc_ba98_u64 as u64 as isize, -2); check_mul_no_wrap!(0xfe_u8 as i8, 2); check_mul_no_wrap!(0xfedc_u16 as i16, 2); check_mul_no_wrap!(0xfedc_ba98_u32 as i32, 2); check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as i64, 2); - check_mul_no_wrap!(0xfedc_ba98_7654_3217_u64 as u64 as isize, 2); + check_mul_no_wrap!(0xfedc_ba98_fedc_ba98_u64 as u64 as isize, 2); check_mul_wraps!(0x80_u8 as i8, -1); check_mul_wraps!(0x8000_u16 as i16, -1);