@@ -1386,7 +1386,6 @@ fn test_non_determinism() {
1386
1386
frem_algebraic, frem_fast, fsub_algebraic, fsub_fast,
1387
1387
} ;
1388
1388
use std:: { f32, f64} ;
1389
- // TODO: Also test powi and powf when the non-determinism is implemented for them
1390
1389
1391
1390
/// Ensure that the operation is non-deterministic
1392
1391
#[ track_caller]
@@ -1426,21 +1425,23 @@ fn test_non_determinism() {
1426
1425
}
1427
1426
pub fn test_operations_f32 ( a : f32 , b : f32 ) {
1428
1427
test_operations_f ! ( a, b) ;
1429
- // FIXME: temporarily disabled as it breaks std tests.
1430
- // ensure_nondet(|| a.log(b));
1431
- // ensure_nondet(|| a.exp());
1432
- // ensure_nondet(|| 10f32.exp2());
1433
- // ensure_nondet(|| f32::consts::E.ln());
1428
+ // FIXME: some are temporarily disabled as it breaks std tests.
1429
+ ensure_nondet ( || a. powf ( b) ) ;
1430
+ ensure_nondet ( || a. powi ( 2 ) ) ;
1431
+ ensure_nondet ( || a. log ( b) ) ;
1432
+ ensure_nondet ( || a. exp ( ) ) ;
1433
+ ensure_nondet ( || 10f32 . exp2 ( ) ) ;
1434
+ ensure_nondet ( || f32:: consts:: E . ln ( ) ) ;
1435
+ ensure_nondet ( || 10f32 . log10 ( ) ) ;
1436
+ ensure_nondet ( || 8f32 . log2 ( ) ) ;
1434
1437
// ensure_nondet(|| 1f32.ln_1p());
1435
- // ensure_nondet(|| 10f32.log10());
1436
- // ensure_nondet(|| 8f32.log2());
1437
1438
// ensure_nondet(|| 27.0f32.cbrt());
1438
1439
// ensure_nondet(|| 3.0f32.hypot(4.0f32));
1439
- // ensure_nondet(|| 1f32.sin());
1440
- // ensure_nondet(|| 0f32 .cos());
1441
- // // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
1442
- // // which means the little rounding errors Miri introduces are discard by the cast down to `f32`.
1443
- // // Just skip the test for them.
1440
+ ensure_nondet ( || 1f32 . sin ( ) ) ;
1441
+ ensure_nondet ( || 1f32 . cos ( ) ) ;
1442
+ // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
1443
+ // which means the little rounding errors Miri introduces are discarded by the cast down to
1444
+ // `f32`. Just skip the test for them.
1444
1445
// if !cfg!(all(target_os = "windows", target_env = "msvc", target_arch = "x86")) {
1445
1446
// ensure_nondet(|| 1.0f32.tan());
1446
1447
// ensure_nondet(|| 1.0f32.asin());
@@ -1461,18 +1462,20 @@ fn test_non_determinism() {
1461
1462
}
1462
1463
pub fn test_operations_f64 ( a : f64 , b : f64 ) {
1463
1464
test_operations_f ! ( a, b) ;
1464
- // FIXME: temporarily disabled as it breaks std tests.
1465
- // ensure_nondet(|| a.log(b));
1466
- // ensure_nondet(|| a.exp());
1467
- // ensure_nondet(|| 50f64.exp2());
1468
- // ensure_nondet(|| 3f64.ln());
1465
+ // FIXME: some are temporarily disabled as it breaks std tests.
1466
+ ensure_nondet ( || a. powf ( b) ) ;
1467
+ ensure_nondet ( || a. powi ( 2 ) ) ;
1468
+ ensure_nondet ( || a. log ( b) ) ;
1469
+ ensure_nondet ( || a. exp ( ) ) ;
1470
+ ensure_nondet ( || 50f64 . exp2 ( ) ) ;
1471
+ ensure_nondet ( || 3f64 . ln ( ) ) ;
1472
+ ensure_nondet ( || f64:: consts:: E . log10 ( ) ) ;
1473
+ ensure_nondet ( || f64:: consts:: E . log2 ( ) ) ;
1469
1474
// ensure_nondet(|| 1f64.ln_1p());
1470
- // ensure_nondet(|| f64::consts::E.log10());
1471
- // ensure_nondet(|| f64::consts::E.log2());
1472
1475
// ensure_nondet(|| 27.0f64.cbrt());
1473
1476
// ensure_nondet(|| 3.0f64.hypot(4.0f64));
1474
- // ensure_nondet(|| 1f64.sin());
1475
- // ensure_nondet(|| 0f64 .cos());
1477
+ ensure_nondet ( || 1f64 . sin ( ) ) ;
1478
+ ensure_nondet ( || 1f64 . cos ( ) ) ;
1476
1479
// ensure_nondet(|| 1.0f64.tan());
1477
1480
// ensure_nondet(|| 1.0f64.asin());
1478
1481
// ensure_nondet(|| 5.0f64.acos());
0 commit comments