summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Clark <stephen.clark@oarcorp.com>2021-03-17 17:48:57 -0500
committerJoel Sherrill <joel@rtems.org>2021-05-05 09:45:56 -0500
commite5590a3ea1da6bc3e57651b51b8c356d881a60bd (patch)
tree90ee892c2babeed34efb2aae30c4ae686a2a99a2
parentstackchk: Fixed 32bit pointers (diff)
downloadrtems-e5590a3ea1da6bc3e57651b51b8c356d881a60bd.tar.bz2
psxtests: Fix math function build warnings
Added conditionals to ensure that long double function tests were only built when newlib has long double math functions.
-rw-r--r--testsuites/psxtests/psxhdrs/math/acoshl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/acosl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/asinhl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/asinl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/atan2l.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/atanhl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/atanl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/cbrtl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/ceill.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/copysignl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/coshl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/cosl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/erfcl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/erfl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/exp2l.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/expl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/expm1l.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fabsl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fdiml.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/floorl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fmal.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fmaxl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fminl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/fmodl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/frexpl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/has_long_double.h54
-rw-r--r--testsuites/psxtests/psxhdrs/math/hypotl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/ilogbl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/ldexpl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/lgammal.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/llrintl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/llroundl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/log10l.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/log1pl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/log2l.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/logbl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/logl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/lrintl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/lroundl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/modfl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nanl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nearbyintl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nextafterl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nexttoward.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nexttowardf.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/nexttowardl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/powl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/remainderl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/remquol.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/rintl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/roundl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/scalblnl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/scalbnl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/sinhl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/sinl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/sqrtl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/tanhl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/tanl.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/tgammal.c3
-rw-r--r--testsuites/psxtests/psxhdrs/math/truncl.c3
60 files changed, 231 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxhdrs/math/acoshl.c b/testsuites/psxtests/psxhdrs/math/acoshl.c
index b6bf0bd16c..fd25a3a1e4 100644
--- a/testsuites/psxtests/psxhdrs/math/acoshl.c
+++ b/testsuites/psxtests/psxhdrs/math/acoshl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/acosl.c b/testsuites/psxtests/psxhdrs/math/acosl.c
index d2235aea76..9176131294 100644
--- a/testsuites/psxtests/psxhdrs/math/acosl.c
+++ b/testsuites/psxtests/psxhdrs/math/acosl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/asinhl.c b/testsuites/psxtests/psxhdrs/math/asinhl.c
index e3a2a0ec9b..607b02dd68 100644
--- a/testsuites/psxtests/psxhdrs/math/asinhl.c
+++ b/testsuites/psxtests/psxhdrs/math/asinhl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result); /* This should return 0 */
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/asinl.c b/testsuites/psxtests/psxhdrs/math/asinl.c
index 1ed9e85b4c..d28833fc5f 100644
--- a/testsuites/psxtests/psxhdrs/math/asinl.c
+++ b/testsuites/psxtests/psxhdrs/math/asinl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ; /* This should return 0 */
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/atan2l.c b/testsuites/psxtests/psxhdrs/math/atan2l.c
index 3ce992afa8..01c13a944e 100644
--- a/testsuites/psxtests/psxhdrs/math/atan2l.c
+++ b/testsuites/psxtests/psxhdrs/math/atan2l.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result) ; /* This should return 0 */
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/atanhl.c b/testsuites/psxtests/psxhdrs/math/atanhl.c
index bf75c1e106..2631ea6670 100644
--- a/testsuites/psxtests/psxhdrs/math/atanhl.c
+++ b/testsuites/psxtests/psxhdrs/math/atanhl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ; /* This should return 0 */
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/atanl.c b/testsuites/psxtests/psxhdrs/math/atanl.c
index 6a1cddc181..b19708c725 100644
--- a/testsuites/psxtests/psxhdrs/math/atanl.c
+++ b/testsuites/psxtests/psxhdrs/math/atanl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ; /* This should return 0 */
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/cbrtl.c b/testsuites/psxtests/psxhdrs/math/cbrtl.c
index 177566cbf2..7c54d661fd 100644
--- a/testsuites/psxtests/psxhdrs/math/cbrtl.c
+++ b/testsuites/psxtests/psxhdrs/math/cbrtl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/ceill.c b/testsuites/psxtests/psxhdrs/math/ceill.c
index 4e9fd1965c..c37e146ccc 100644
--- a/testsuites/psxtests/psxhdrs/math/ceill.c
+++ b/testsuites/psxtests/psxhdrs/math/ceill.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/copysignl.c b/testsuites/psxtests/psxhdrs/math/copysignl.c
index 448d14e710..db5e57e6f6 100644
--- a/testsuites/psxtests/psxhdrs/math/copysignl.c
+++ b/testsuites/psxtests/psxhdrs/math/copysignl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/coshl.c b/testsuites/psxtests/psxhdrs/math/coshl.c
index 38b6c5525d..7281a37d0f 100644
--- a/testsuites/psxtests/psxhdrs/math/coshl.c
+++ b/testsuites/psxtests/psxhdrs/math/coshl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/cosl.c b/testsuites/psxtests/psxhdrs/math/cosl.c
index fff10803df..7eacbf89ae 100644
--- a/testsuites/psxtests/psxhdrs/math/cosl.c
+++ b/testsuites/psxtests/psxhdrs/math/cosl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/erfcl.c b/testsuites/psxtests/psxhdrs/math/erfcl.c
index bea370c94b..9a50718891 100644
--- a/testsuites/psxtests/psxhdrs/math/erfcl.c
+++ b/testsuites/psxtests/psxhdrs/math/erfcl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/erfl.c b/testsuites/psxtests/psxhdrs/math/erfl.c
index 35bb58a2a3..5983f6e875 100644
--- a/testsuites/psxtests/psxhdrs/math/erfl.c
+++ b/testsuites/psxtests/psxhdrs/math/erfl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/exp2l.c b/testsuites/psxtests/psxhdrs/math/exp2l.c
index cc39afde75..02e21ae312 100644
--- a/testsuites/psxtests/psxhdrs/math/exp2l.c
+++ b/testsuites/psxtests/psxhdrs/math/exp2l.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/expl.c b/testsuites/psxtests/psxhdrs/math/expl.c
index 1ae0f8ceae..39e61f03e7 100644
--- a/testsuites/psxtests/psxhdrs/math/expl.c
+++ b/testsuites/psxtests/psxhdrs/math/expl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/expm1l.c b/testsuites/psxtests/psxhdrs/math/expm1l.c
index e677e0a3ba..23ac312207 100644
--- a/testsuites/psxtests/psxhdrs/math/expm1l.c
+++ b/testsuites/psxtests/psxhdrs/math/expm1l.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fabsl.c b/testsuites/psxtests/psxhdrs/math/fabsl.c
index d32bd7b999..0b5f432bfd 100644
--- a/testsuites/psxtests/psxhdrs/math/fabsl.c
+++ b/testsuites/psxtests/psxhdrs/math/fabsl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fdiml.c b/testsuites/psxtests/psxhdrs/math/fdiml.c
index 000c6efdd4..b6a7ba4c65 100644
--- a/testsuites/psxtests/psxhdrs/math/fdiml.c
+++ b/testsuites/psxtests/psxhdrs/math/fdiml.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/floorl.c b/testsuites/psxtests/psxhdrs/math/floorl.c
index 8a34358f30..c19db68160 100644
--- a/testsuites/psxtests/psxhdrs/math/floorl.c
+++ b/testsuites/psxtests/psxhdrs/math/floorl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fmal.c b/testsuites/psxtests/psxhdrs/math/fmal.c
index baf80a7684..13459a7f0b 100644
--- a/testsuites/psxtests/psxhdrs/math/fmal.c
+++ b/testsuites/psxtests/psxhdrs/math/fmal.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -49,3 +51,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fmaxl.c b/testsuites/psxtests/psxhdrs/math/fmaxl.c
index 68bb6a0ef3..ed711c9ce7 100644
--- a/testsuites/psxtests/psxhdrs/math/fmaxl.c
+++ b/testsuites/psxtests/psxhdrs/math/fmaxl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fminl.c b/testsuites/psxtests/psxhdrs/math/fminl.c
index b8c5dfb349..9a86ee7e63 100644
--- a/testsuites/psxtests/psxhdrs/math/fminl.c
+++ b/testsuites/psxtests/psxhdrs/math/fminl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/fmodl.c b/testsuites/psxtests/psxhdrs/math/fmodl.c
index 7111ff6f7d..2f562efcea 100644
--- a/testsuites/psxtests/psxhdrs/math/fmodl.c
+++ b/testsuites/psxtests/psxhdrs/math/fmodl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/frexpl.c b/testsuites/psxtests/psxhdrs/math/frexpl.c
index 3ad3e25a5d..ad827d7b07 100644
--- a/testsuites/psxtests/psxhdrs/math/frexpl.c
+++ b/testsuites/psxtests/psxhdrs/math/frexpl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/has_long_double.h b/testsuites/psxtests/psxhdrs/math/has_long_double.h
new file mode 100644
index 0000000000..aeef1e466a
--- /dev/null
+++ b/testsuites/psxtests/psxhdrs/math/has_long_double.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ * @file
+ *
+ * @brief Defines NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
+ *
+ * This file uses logic copied from newlib's math.h on 21 Jan 2021
+ * to determine whether or not the long double math functions tests
+ * should be built. The original math.h file was sourced from
+ * https://codeload.github.com/RTEMS/sourceware-mirror-newlib-cygwin/tar.gz/a0d7982
+ * The original math.h this is based on has no license or copyright notice
+ */
+
+/*
+ * Copyright (C) 2021 OAR Corporation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HAS_LONG_DOUBLE_H
+#define HAS_LONG_DOUBLE_H
+
+/* Newlib doesn't fully support long double math functions so far.
+ On platforms where long double equals double the long double functions
+ simply call the double functions. On Cygwin the long double functions
+ are implemented independently from newlib to be able to use optimized
+ assembler functions despite using the Microsoft x86_64 ABI. */
+#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__)
+#ifndef __math_68881
+#define NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS 1
+#endif
+#endif
+
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/hypotl.c b/testsuites/psxtests/psxhdrs/math/hypotl.c
index bffc632c09..182e4028d8 100644
--- a/testsuites/psxtests/psxhdrs/math/hypotl.c
+++ b/testsuites/psxtests/psxhdrs/math/hypotl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/ilogbl.c b/testsuites/psxtests/psxhdrs/math/ilogbl.c
index 8daa32df84..9c8486c79d 100644
--- a/testsuites/psxtests/psxhdrs/math/ilogbl.c
+++ b/testsuites/psxtests/psxhdrs/math/ilogbl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/ldexpl.c b/testsuites/psxtests/psxhdrs/math/ldexpl.c
index de1a2dcb8a..369f95116f 100644
--- a/testsuites/psxtests/psxhdrs/math/ldexpl.c
+++ b/testsuites/psxtests/psxhdrs/math/ldexpl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/lgammal.c b/testsuites/psxtests/psxhdrs/math/lgammal.c
index 156b39092b..c126812427 100644
--- a/testsuites/psxtests/psxhdrs/math/lgammal.c
+++ b/testsuites/psxtests/psxhdrs/math/lgammal.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/llrintl.c b/testsuites/psxtests/psxhdrs/math/llrintl.c
index f8e73ac4dd..500a7ef14f 100644
--- a/testsuites/psxtests/psxhdrs/math/llrintl.c
+++ b/testsuites/psxtests/psxhdrs/math/llrintl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/llroundl.c b/testsuites/psxtests/psxhdrs/math/llroundl.c
index ed085e46cd..672ef06887 100644
--- a/testsuites/psxtests/psxhdrs/math/llroundl.c
+++ b/testsuites/psxtests/psxhdrs/math/llroundl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/log10l.c b/testsuites/psxtests/psxhdrs/math/log10l.c
index 0339489020..5918a7a8d7 100644
--- a/testsuites/psxtests/psxhdrs/math/log10l.c
+++ b/testsuites/psxtests/psxhdrs/math/log10l.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/log1pl.c b/testsuites/psxtests/psxhdrs/math/log1pl.c
index 98015c01c2..1f92653703 100644
--- a/testsuites/psxtests/psxhdrs/math/log1pl.c
+++ b/testsuites/psxtests/psxhdrs/math/log1pl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/log2l.c b/testsuites/psxtests/psxhdrs/math/log2l.c
index 7d29cc505f..30e1c0aab0 100644
--- a/testsuites/psxtests/psxhdrs/math/log2l.c
+++ b/testsuites/psxtests/psxhdrs/math/log2l.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/logbl.c b/testsuites/psxtests/psxhdrs/math/logbl.c
index d50f50fa8c..ffddfd6fcf 100644
--- a/testsuites/psxtests/psxhdrs/math/logbl.c
+++ b/testsuites/psxtests/psxhdrs/math/logbl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/logl.c b/testsuites/psxtests/psxhdrs/math/logl.c
index 11b46163d0..3506148b60 100644
--- a/testsuites/psxtests/psxhdrs/math/logl.c
+++ b/testsuites/psxtests/psxhdrs/math/logl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/lrintl.c b/testsuites/psxtests/psxhdrs/math/lrintl.c
index 2430b18736..5e535b91a9 100644
--- a/testsuites/psxtests/psxhdrs/math/lrintl.c
+++ b/testsuites/psxtests/psxhdrs/math/lrintl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/lroundl.c b/testsuites/psxtests/psxhdrs/math/lroundl.c
index a79bdeb095..823ae2fb14 100644
--- a/testsuites/psxtests/psxhdrs/math/lroundl.c
+++ b/testsuites/psxtests/psxhdrs/math/lroundl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/modfl.c b/testsuites/psxtests/psxhdrs/math/modfl.c
index ed0c5fd090..e55b9111bf 100644
--- a/testsuites/psxtests/psxhdrs/math/modfl.c
+++ b/testsuites/psxtests/psxhdrs/math/modfl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nanl.c b/testsuites/psxtests/psxhdrs/math/nanl.c
index 71928589f5..631fb32fa5 100644
--- a/testsuites/psxtests/psxhdrs/math/nanl.c
+++ b/testsuites/psxtests/psxhdrs/math/nanl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nearbyintl.c b/testsuites/psxtests/psxhdrs/math/nearbyintl.c
index 38a681bf09..bea7d94209 100644
--- a/testsuites/psxtests/psxhdrs/math/nearbyintl.c
+++ b/testsuites/psxtests/psxhdrs/math/nearbyintl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nextafterl.c b/testsuites/psxtests/psxhdrs/math/nextafterl.c
index 2b0fb54420..428056971e 100644
--- a/testsuites/psxtests/psxhdrs/math/nextafterl.c
+++ b/testsuites/psxtests/psxhdrs/math/nextafterl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nexttoward.c b/testsuites/psxtests/psxhdrs/math/nexttoward.c
index e84ac5c4ce..f73d1fa200 100644
--- a/testsuites/psxtests/psxhdrs/math/nexttoward.c
+++ b/testsuites/psxtests/psxhdrs/math/nexttoward.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nexttowardf.c b/testsuites/psxtests/psxhdrs/math/nexttowardf.c
index ceb2a99303..e65e68d45e 100644
--- a/testsuites/psxtests/psxhdrs/math/nexttowardf.c
+++ b/testsuites/psxtests/psxhdrs/math/nexttowardf.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/nexttowardl.c b/testsuites/psxtests/psxhdrs/math/nexttowardl.c
index c94ea4d20e..d895e3fe0c 100644
--- a/testsuites/psxtests/psxhdrs/math/nexttowardl.c
+++ b/testsuites/psxtests/psxhdrs/math/nexttowardl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/powl.c b/testsuites/psxtests/psxhdrs/math/powl.c
index da68a82670..e39d21124c 100644
--- a/testsuites/psxtests/psxhdrs/math/powl.c
+++ b/testsuites/psxtests/psxhdrs/math/powl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/remainderl.c b/testsuites/psxtests/psxhdrs/math/remainderl.c
index 4323669c7a..6d505a8c67 100644
--- a/testsuites/psxtests/psxhdrs/math/remainderl.c
+++ b/testsuites/psxtests/psxhdrs/math/remainderl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/remquol.c b/testsuites/psxtests/psxhdrs/math/remquol.c
index 4c56301413..e3b796ef9a 100644
--- a/testsuites/psxtests/psxhdrs/math/remquol.c
+++ b/testsuites/psxtests/psxhdrs/math/remquol.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/rintl.c b/testsuites/psxtests/psxhdrs/math/rintl.c
index 3f6a850e9d..4fbd5cfa3f 100644
--- a/testsuites/psxtests/psxhdrs/math/rintl.c
+++ b/testsuites/psxtests/psxhdrs/math/rintl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/roundl.c b/testsuites/psxtests/psxhdrs/math/roundl.c
index 421b18b816..a86a44ecaf 100644
--- a/testsuites/psxtests/psxhdrs/math/roundl.c
+++ b/testsuites/psxtests/psxhdrs/math/roundl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/scalblnl.c b/testsuites/psxtests/psxhdrs/math/scalblnl.c
index fb806033f4..e3fd17d698 100644
--- a/testsuites/psxtests/psxhdrs/math/scalblnl.c
+++ b/testsuites/psxtests/psxhdrs/math/scalblnl.c
@@ -35,8 +35,10 @@
#endif
#include <math.h>
+#include "has_long_double.h"
#include <float.h>
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/scalbnl.c b/testsuites/psxtests/psxhdrs/math/scalbnl.c
index 578c2495f6..65f28ba77d 100644
--- a/testsuites/psxtests/psxhdrs/math/scalbnl.c
+++ b/testsuites/psxtests/psxhdrs/math/scalbnl.c
@@ -35,8 +35,10 @@
#endif
#include <math.h>
+#include "has_long_double.h"
#include <float.h>
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -48,3 +50,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/sinhl.c b/testsuites/psxtests/psxhdrs/math/sinhl.c
index 645a789283..a55104c8e1 100644
--- a/testsuites/psxtests/psxhdrs/math/sinhl.c
+++ b/testsuites/psxtests/psxhdrs/math/sinhl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/sinl.c b/testsuites/psxtests/psxhdrs/math/sinl.c
index ae75af5536..228027e9b2 100644
--- a/testsuites/psxtests/psxhdrs/math/sinl.c
+++ b/testsuites/psxtests/psxhdrs/math/sinl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/sqrtl.c b/testsuites/psxtests/psxhdrs/math/sqrtl.c
index 0fc940e02c..c491b74700 100644
--- a/testsuites/psxtests/psxhdrs/math/sqrtl.c
+++ b/testsuites/psxtests/psxhdrs/math/sqrtl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/tanhl.c b/testsuites/psxtests/psxhdrs/math/tanhl.c
index 7a123f969f..5cb219c723 100644
--- a/testsuites/psxtests/psxhdrs/math/tanhl.c
+++ b/testsuites/psxtests/psxhdrs/math/tanhl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -47,3 +49,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/tanl.c b/testsuites/psxtests/psxhdrs/math/tanl.c
index 3f8aba57dc..b6c20a3304 100644
--- a/testsuites/psxtests/psxhdrs/math/tanl.c
+++ b/testsuites/psxtests/psxhdrs/math/tanl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result) ;
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/tgammal.c b/testsuites/psxtests/psxhdrs/math/tgammal.c
index a5e8d7c44a..6a9518a766 100644
--- a/testsuites/psxtests/psxhdrs/math/tgammal.c
+++ b/testsuites/psxtests/psxhdrs/math/tgammal.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif
diff --git a/testsuites/psxtests/psxhdrs/math/truncl.c b/testsuites/psxtests/psxhdrs/math/truncl.c
index 0590ffad90..6a657dd79b 100644
--- a/testsuites/psxtests/psxhdrs/math/truncl.c
+++ b/testsuites/psxtests/psxhdrs/math/truncl.c
@@ -35,7 +35,9 @@
#endif
#include <math.h>
+#include "has_long_double.h"
+#if defined NEWLIB_HAS_LONG_DOUBLE_MATH_FUNCTIONS
int test( void );
int test( void )
@@ -46,3 +48,4 @@ int test( void )
return (result);
}
+#endif