]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/mir/mir_overflow_off.rs
2 // compile-flags: -C overflow-checks=off
4 // Test that with MIR codegen, overflow checks can be
5 // turned off, even when they're from core::ops::*.
10 assert_eq
!(i8::neg(-0x80), -0x80);
12 assert_eq
!(u8::add(0xff, 1), 0_u8);
13 assert_eq
!(u8::sub(0, 1), 0xff_u8);
14 assert_eq
!(u8::mul(0xff, 2), 0xfe_u8);
15 assert_eq
!(u8::shl(1, 9), 2_u8);
16 assert_eq
!(u8::shr(2, 9), 1_u8);