Fix overflow checking in shift operator

This commit is contained in:
hkalbasi 2023-07-01 17:16:56 +03:30
parent bb85a980e0
commit 15a0da6f30
2 changed files with 7 additions and 1 deletions

View file

@ -108,6 +108,7 @@ fn bit_op() {
check_fail(r#"const GOAL: i8 = 1 << 8"#, |e| {
e == ConstEvalError::MirEvalError(MirEvalError::Panic("Overflow in Shl".to_string()))
});
check_number(r#"const GOAL: i32 = 100000000i32 << 11"#, (100000000i32 << 11) as i128);
}
#[test]