Skip to content

Commit 274f736

Browse files
authored
Rollup merge of rust-lang#146737 - RalfJung:f16-f128-miri, r=tgross35
f16_f128: enable some more tests in Miri For some reason, a bunch of tests were disabled in Miri that don't use any fancy intrinsics. Let's enable them. I verified this with `./x miri library/core --no-doc -- float`. r? `@tgross35`
2 parents a27d317 + d3d8a40 commit 274f736

File tree

1 file changed

+15
-17
lines changed
  • library/coretests/tests/floats

1 file changed

+15
-17
lines changed

library/coretests/tests/floats/mod.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,15 +1190,12 @@ float_test! {
11901190
}
11911191
}
11921192

1193-
// FIXME(f16_f128,miri): many of these have to be disabled since miri does not yet support
1194-
// the intrinsics.
1195-
11961193
float_test! {
11971194
name: sqrt_domain,
11981195
attrs: {
11991196
const: #[cfg(false)],
1200-
f16: #[cfg(all(not(miri), target_has_reliable_f16_math))],
1201-
f128: #[cfg(all(not(miri), target_has_reliable_f128_math))],
1197+
f16: #[cfg(any(miri, target_has_reliable_f16_math))],
1198+
f128: #[cfg(any(miri, target_has_reliable_f128_math))],
12021199
},
12031200
test<Float> {
12041201
assert!(Float::NAN.sqrt().is_nan());
@@ -1257,8 +1254,8 @@ float_test! {
12571254
name: total_cmp,
12581255
attrs: {
12591256
const: #[cfg(false)],
1260-
f16: #[cfg(all(not(miri), target_has_reliable_f16_math))],
1261-
f128: #[cfg(all(not(miri), target_has_reliable_f128_math))],
1257+
f16: #[cfg(any(miri, target_has_reliable_f16_math))],
1258+
f128: #[cfg(any(miri, target_has_reliable_f128_math))],
12621259
},
12631260
test<Float> {
12641261
use core::cmp::Ordering;
@@ -1366,8 +1363,8 @@ float_test! {
13661363
name: total_cmp_s_nan,
13671364
attrs: {
13681365
const: #[cfg(false)],
1369-
f16: #[cfg(false)],
1370-
f128: #[cfg(all(not(miri), target_has_reliable_f128_math))],
1366+
f16: #[cfg(miri)],
1367+
f128: #[cfg(any(miri, target_has_reliable_f128_math))],
13711368
},
13721369
test<Float> {
13731370
use core::cmp::Ordering;
@@ -1443,6 +1440,7 @@ float_test! {
14431440
name: powi,
14441441
attrs: {
14451442
const: #[cfg(false)],
1443+
// FIXME(f16_f128): `powi` does not work in Miri for these types
14461444
f16: #[cfg(all(not(miri), target_has_reliable_f16_math))],
14471445
f128: #[cfg(all(not(miri), target_has_reliable_f128_math))],
14481446
},
@@ -1463,8 +1461,8 @@ float_test! {
14631461
float_test! {
14641462
name: to_degrees,
14651463
attrs: {
1466-
f16: #[cfg(target_has_reliable_f16)],
1467-
f128: #[cfg(target_has_reliable_f128)],
1464+
f16: #[cfg(any(miri, target_has_reliable_f16))],
1465+
f128: #[cfg(any(miri, target_has_reliable_f128))],
14681466
},
14691467
test<Float> {
14701468
let pi: Float = Float::PI;
@@ -1484,8 +1482,8 @@ float_test! {
14841482
float_test! {
14851483
name: to_radians,
14861484
attrs: {
1487-
f16: #[cfg(target_has_reliable_f16)],
1488-
f128: #[cfg(target_has_reliable_f128)],
1485+
f16: #[cfg(any(miri, target_has_reliable_f16))],
1486+
f128: #[cfg(any(miri, target_has_reliable_f128))],
14891487
},
14901488
test<Float> {
14911489
let pi: Float = Float::PI;
@@ -1505,8 +1503,8 @@ float_test! {
15051503
float_test! {
15061504
name: to_algebraic,
15071505
attrs: {
1508-
f16: #[cfg(target_has_reliable_f16)],
1509-
f128: #[cfg(target_has_reliable_f128)],
1506+
f16: #[cfg(any(miri, target_has_reliable_f16))],
1507+
f128: #[cfg(any(miri, target_has_reliable_f128))],
15101508
},
15111509
test<Float> {
15121510
let a: Float = 123.0;
@@ -1529,8 +1527,8 @@ float_test! {
15291527
float_test! {
15301528
name: to_bits_conv,
15311529
attrs: {
1532-
f16: #[cfg(target_has_reliable_f16)],
1533-
f128: #[cfg(target_has_reliable_f128)],
1530+
f16: #[cfg(any(miri, target_has_reliable_f16))],
1531+
f128: #[cfg(any(miri, target_has_reliable_f128))],
15341532
},
15351533
test<Float> {
15361534
assert_biteq!(flt(1.0), Float::RAW_1);

0 commit comments

Comments
 (0)