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.)
This commit is contained in:
Felix S. Klock II 2015-04-17 02:03:38 +02:00
parent 0610ee490e
commit 4f67850964

View File

@ -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);