@@ -1278,7 +1278,6 @@ fn test_non_determinism() {
1278
1278
frem_algebraic, frem_fast, fsub_algebraic, fsub_fast,
1279
1279
} ;
1280
1280
use std:: { f32, f64} ;
1281
- // TODO: Also test powi and powf when the non-determinism is implemented for them
1282
1281
1283
1282
/// Ensure that the operation is non-deterministic
1284
1283
#[ track_caller]
@@ -1318,21 +1317,23 @@ fn test_non_determinism() {
1318
1317
}
1319
1318
pub fn test_operations_f32 ( a : f32 , b : f32 ) {
1320
1319
test_operations_f ! ( a, b) ;
1321
- // FIXME: temporarily disabled as it breaks std tests.
1322
- // ensure_nondet(|| a.log(b));
1323
- // ensure_nondet(|| a.exp());
1324
- // ensure_nondet(|| 10f32.exp2());
1325
- // ensure_nondet(|| f32::consts::E.ln());
1320
+ // FIXME: some are temporarily disabled as it breaks std tests.
1321
+ ensure_nondet ( || a. powf ( b) ) ;
1322
+ ensure_nondet ( || a. powi ( 2 ) ) ;
1323
+ ensure_nondet ( || a. log ( b) ) ;
1324
+ ensure_nondet ( || a. exp ( ) ) ;
1325
+ ensure_nondet ( || 10f32 . exp2 ( ) ) ;
1326
+ ensure_nondet ( || f32:: consts:: E . ln ( ) ) ;
1327
+ ensure_nondet ( || 10f32 . log10 ( ) ) ;
1328
+ ensure_nondet ( || 8f32 . log2 ( ) ) ;
1326
1329
// ensure_nondet(|| 1f32.ln_1p());
1327
- // ensure_nondet(|| 10f32.log10());
1328
- // ensure_nondet(|| 8f32.log2());
1329
1330
// ensure_nondet(|| 27.0f32.cbrt());
1330
1331
// ensure_nondet(|| 3.0f32.hypot(4.0f32));
1331
- // ensure_nondet(|| 1f32.sin());
1332
- // ensure_nondet(|| 0f32.cos());
1333
- // // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
1334
- // // which means the little rounding errors Miri introduces are discard by the cast down to `f32`.
1335
- // // Just skip the test for them.
1332
+ ensure_nondet ( || 1f32 . sin ( ) ) ;
1333
+ ensure_nondet ( || 0f32 . cos ( ) ) ;
1334
+ // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
1335
+ // which means the little rounding errors Miri introduces are discarded by the cast down to
1336
+ // `f32`. Just skip the test for them.
1336
1337
// if !cfg!(all(target_os = "windows", target_env = "msvc", target_arch = "x86")) {
1337
1338
// ensure_nondet(|| 1.0f32.tan());
1338
1339
// ensure_nondet(|| 1.0f32.asin());
@@ -1353,18 +1354,20 @@ fn test_non_determinism() {
1353
1354
}
1354
1355
pub fn test_operations_f64 ( a : f64 , b : f64 ) {
1355
1356
test_operations_f ! ( a, b) ;
1356
- // FIXME: temporarily disabled as it breaks std tests.
1357
- // ensure_nondet(|| a.log(b));
1358
- // ensure_nondet(|| a.exp());
1359
- // ensure_nondet(|| 50f64.exp2());
1360
- // ensure_nondet(|| 3f64.ln());
1357
+ // FIXME: some are temporarily disabled as it breaks std tests.
1358
+ ensure_nondet ( || a. powf ( b) ) ;
1359
+ ensure_nondet ( || a. powi ( 2 ) ) ;
1360
+ ensure_nondet ( || a. log ( b) ) ;
1361
+ ensure_nondet ( || a. exp ( ) ) ;
1362
+ ensure_nondet ( || 50f64 . exp2 ( ) ) ;
1363
+ ensure_nondet ( || 3f64 . ln ( ) ) ;
1364
+ ensure_nondet ( || f64:: consts:: E . log10 ( ) ) ;
1365
+ ensure_nondet ( || f64:: consts:: E . log2 ( ) ) ;
1361
1366
// ensure_nondet(|| 1f64.ln_1p());
1362
- // ensure_nondet(|| f64::consts::E.log10());
1363
- // ensure_nondet(|| f64::consts::E.log2());
1364
1367
// ensure_nondet(|| 27.0f64.cbrt());
1365
1368
// ensure_nondet(|| 3.0f64.hypot(4.0f64));
1366
- // ensure_nondet(|| 1f64.sin());
1367
- // ensure_nondet(|| 0f64.cos());
1369
+ ensure_nondet ( || 1f64 . sin ( ) ) ;
1370
+ ensure_nondet ( || 0f64 . cos ( ) ) ;
1368
1371
// ensure_nondet(|| 1.0f64.tan());
1369
1372
// ensure_nondet(|| 1.0f64.asin());
1370
1373
// ensure_nondet(|| 5.0f64.acos());
0 commit comments