File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/tools/miri/tests/pass Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ fn basic() {
168168 let x: u32 = unsafe { std:: mem:: transmute ( 42.0_f32 ) } ;
169169 let y: f32 = unsafe { std:: mem:: transmute ( x) } ;
170170 assert_eq ( y, 42.0_f32 ) ;
171+
172+ // `%` sign behavior, some of this used to be buggy
173+ assert ! ( ( black_box( 1.0f32 ) % 1.0 ) . is_sign_positive( ) ) ;
174+ assert ! ( ( black_box( 1.0f32 ) % -1.0 ) . is_sign_positive( ) ) ;
175+ assert ! ( ( black_box( -1.0f32 ) % 1.0 ) . is_sign_negative( ) ) ;
176+ assert ! ( ( black_box( -1.0f32 ) % -1.0 ) . is_sign_negative( ) ) ;
177+ assert ! ( ( black_box( 1.0f64 ) % 1.0 ) . is_sign_positive( ) ) ;
178+ assert ! ( ( black_box( 1.0f64 ) % -1.0 ) . is_sign_positive( ) ) ;
179+ assert ! ( ( black_box( -1.0f64 ) % 1.0 ) . is_sign_negative( ) ) ;
180+ assert ! ( ( black_box( -1.0f64 ) % -1.0 ) . is_sign_negative( ) ) ;
171181}
172182
173183/// Many of these test values are taken from
You can’t perform that action at this time.
0 commit comments