File tree Expand file tree Collapse file tree 9 files changed +18
-9
lines changed
tests/kani/Intrinsics/Math/Arith/Unchecked Expand file tree Collapse file tree 9 files changed +18
-9
lines changed Original file line number Diff line number Diff line change 99fn main ( ) {
1010 let a: i32 = kani:: any ( ) ;
1111 let b: i32 = kani:: any ( ) ;
12- unsafe { std:: intrinsics:: unchecked_add ( a, b) } ;
12+ // Black box this so it doesn't get pruned by the compiler.
13+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_add ( a, b) } ) ;
1314}
Original file line number Diff line number Diff line change 1010fn main ( ) {
1111 let a: i32 = i32:: MIN ;
1212 let b: i32 = -1 ;
13- unsafe { std:: intrinsics:: unchecked_div ( a, b) } ;
13+ // Black box this so it doesn't get pruned by the compiler.
14+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_div ( a, b) } ) ;
1415}
Original file line number Diff line number Diff line change 1010fn main ( ) {
1111 let a: i32 = kani:: any ( ) ;
1212 let b: i32 = 0 ;
13- unsafe { std:: intrinsics:: unchecked_div ( a, b) } ;
13+ // Black box this so it doesn't get pruned by the compiler.
14+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_div ( a, b) } ) ;
1415}
Original file line number Diff line number Diff line change 99fn main ( ) {
1010 let a: i32 = kani:: any ( ) ;
1111 let b: i32 = kani:: any ( ) ;
12- unsafe { std:: intrinsics:: unchecked_mul ( a, b) } ;
12+ // Black box this so it doesn't get pruned by the compiler.
13+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_mul ( a, b) } ) ;
1314}
Original file line number Diff line number Diff line change 1010fn main ( ) {
1111 let a: i32 = i32:: MIN ;
1212 let b: i32 = -1 ;
13- unsafe { std:: intrinsics:: unchecked_rem ( a, b) } ;
13+ // Black box this so it doesn't get pruned by the compiler.
14+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_rem ( a, b) } ) ;
1415}
Original file line number Diff line number Diff line change 1010fn main ( ) {
1111 let a: i32 = kani:: any ( ) ;
1212 let b: i32 = 0 ;
13- unsafe { std:: intrinsics:: unchecked_rem ( a, b) } ;
13+ // Black box this so it doesn't get pruned by the compiler.
14+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_rem ( a, b) } ) ;
1415}
Original file line number Diff line number Diff line change 99fn main ( ) {
1010 let a: u32 = kani:: any ( ) ;
1111 let b: u32 = kani:: any ( ) ;
12- unsafe { std:: intrinsics:: unchecked_shl ( a, b) } ;
12+ // Black box this so it doesn't get pruned by the compiler.
13+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_shl ( a, b) } ) ;
1314}
Original file line number Diff line number Diff line change 99fn main ( ) {
1010 let a: u32 = kani:: any ( ) ;
1111 let b: u32 = kani:: any ( ) ;
12- unsafe { std:: intrinsics:: unchecked_shr ( a, b) } ;
12+ // Black box this so it doesn't get pruned by the compiler.
13+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_shr ( a, b) } ) ;
1314}
Original file line number Diff line number Diff line change 99fn main ( ) {
1010 let a: i32 = kani:: any ( ) ;
1111 let b: i32 = kani:: any ( ) ;
12- unsafe { std:: intrinsics:: unchecked_sub ( a, b) } ;
12+ // Black box this so it doesn't get pruned by the compiler.
13+ std:: hint:: black_box ( unsafe { std:: intrinsics:: unchecked_sub ( a, b) } ) ;
1314}
You can’t perform that action at this time.
0 commit comments