about summary refs log tree commit diff
path: root/library/compiler-builtins/testcrate/tests/float_pow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/compiler-builtins/testcrate/tests/float_pow.rs')
-rw-r--r--library/compiler-builtins/testcrate/tests/float_pow.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/library/compiler-builtins/testcrate/tests/float_pow.rs b/library/compiler-builtins/testcrate/tests/float_pow.rs
index 761a6611dda..d85ee99dfd3 100644
--- a/library/compiler-builtins/testcrate/tests/float_pow.rs
+++ b/library/compiler-builtins/testcrate/tests/float_pow.rs
@@ -1,4 +1,5 @@
 #![allow(unused_macros)]
+#![cfg_attr(f128_enabled, feature(f128))]
 #![cfg(not(all(target_arch = "x86", not(target_feature = "sse"))))]
 
 use testcrate::*;
@@ -7,9 +8,12 @@ use testcrate::*;
 // https://github.com/rust-lang/rust/issues/73920.
 // TODO how do we resolve this indeterminacy?
 macro_rules! pow {
-    ($($f:ty, $tolerance:expr, $fn:ident);*;) => {
+    ($($f:ty, $tolerance:expr, $fn:ident, $sys_available:meta);*;) => {
         $(
             #[test]
+            // FIXME(apfloat): We skip tests if system symbols aren't available rather
+            // than providing a fallback, since `rustc_apfloat` does not provide `pow`.
+            #[cfg($sys_available)]
             fn $fn() {
                 use compiler_builtins::float::pow::$fn;
                 use compiler_builtins::float::Float;
@@ -49,6 +53,20 @@ macro_rules! pow {
 }
 
 pow! {
-    f32, 1e-4, __powisf2;
-    f64, 1e-12, __powidf2;
+    f32, 1e-4, __powisf2, all();
+    f64, 1e-12, __powidf2, all();
+}
+
+#[cfg(f128_enabled)]
+// FIXME(f16_f128): MSVC cannot build these until `__divtf3` is available in nightly.
+#[cfg(not(target_env = "msvc"))]
+#[cfg(not(any(target_arch = "powerpc", target_arch = "powerpc64")))]
+pow! {
+    f128, 1e-36, __powitf2, not(feature = "no-sys-f128");
+}
+
+#[cfg(f128_enabled)]
+#[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
+pow! {
+    f128, 1e-36, __powikf2, not(feature = "no-sys-f128");
 }