1 //@compile-flags: -C overflow-checks=off
3 // Check that we correctly implement the intended behavior of these operators
4 // when they are not being overflow-checked.
6 // FIXME: if we call the functions in `std::ops`, we still get the panics.
7 // Miri does not implement the codegen-time hack that backs `#[rustc_inherit_overflow_checks]`.
11 assert_eq!(-{ -0x80i8 }, -0x80);
13 assert_eq!(0xffu8 + 1, 0_u8);
14 assert_eq!(0u8 - 1, 0xff_u8);
15 assert_eq!(0xffu8 * 2, 0xfe_u8);
16 assert_eq!(1u8 << 9, 2_u8);
17 assert_eq!(2u8 >> 9, 1_u8);