This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +0
-8
lines changed
src/tools/miri/tests/fail/intrinsics Expand file tree Collapse file tree 6 files changed +0
-8
lines changed Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
2-
31fn main ( ) {
42 // MAX overflow
53 let _val = unsafe { 40000u16 . unchecked_add ( 30000 ) } ; //~ ERROR: overflow executing `unchecked_add`
Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
2-
31fn main ( ) {
42 // MIN overflow
53 let _val = unsafe { ( -30000i16 ) . unchecked_add ( -8000 ) } ; //~ ERROR: overflow executing `unchecked_add`
Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
21fn main ( ) {
32 // MAX overflow
43 let _val = unsafe { 300u16 . unchecked_mul ( 250u16 ) } ; //~ ERROR: overflow executing `unchecked_mul`
Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
21fn main ( ) {
32 // MIN overflow
43 let _val = unsafe { 1_000_000_000i32 . unchecked_mul ( -4 ) } ; //~ ERROR: overflow executing `unchecked_mul`
Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
21fn main ( ) {
32 // MIN overflow
43 let _val = unsafe { 14u32 . unchecked_sub ( 22 ) } ; //~ ERROR: overflow executing `unchecked_sub`
Original file line number Diff line number Diff line change 1- #![ feature( unchecked_math) ]
21fn main ( ) {
32 // MAX overflow
43 let _val = unsafe { 30000i16 . unchecked_sub ( -7000 ) } ; //~ ERROR: overflow executing `unchecked_sub`
You can’t perform that action at this time.
0 commit comments