Fix the overflowing tests in run-fail.
* The error patterns had a typo. * Our current constant evaluation would silently allow the overflow (filed as Issue 22531). * The overflowing-mul test was accidentally doing addition instead of multiplication.
This commit is contained in:
parent
e7c986105f
commit
4394720dae
3 changed files with 15 additions and 6 deletions
|
@ -8,8 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:thread '<main>' panicked at 'arithmatic operation overflowed'
|
||||
// error-pattern:thread '<main>' panicked at 'arithmetic operation overflowed'
|
||||
|
||||
// (Work around constant-evaluation)
|
||||
fn value() -> u8 { 200 }
|
||||
|
||||
fn main() {
|
||||
let x = 200u8 + 200u8 + 200u8;
|
||||
let _x = value() + value() + value();
|
||||
}
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:thread '<main>' panicked at 'arithmatic operation overflowed'
|
||||
// error-pattern:thread '<main>' panicked at 'arithmetic operation overflowed'
|
||||
|
||||
// (Work around constant-evaluation)
|
||||
fn value() -> u8 { 200 }
|
||||
|
||||
fn main() {
|
||||
let x = 200u8 + 4u8;
|
||||
let x = value() * 4;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:thread '<main>' panicked at 'arithmatic operation overflowed'
|
||||
// error-pattern:thread '<main>' panicked at 'arithmetic operation overflowed'
|
||||
|
||||
// (Work around constant-evaluation)
|
||||
fn value() -> u8 { 42 }
|
||||
|
||||
fn main() {
|
||||
let x = 42u8 - 43u8;
|
||||
let _x = value() - (value() + 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue