]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - math/test-fpucw.c
Add run-one-test convenience target and makefile help text
[thirdparty/glibc.git] / math / test-fpucw.c
index 6d638c66caf6141167bae1aaba9bb886b8d49e3b..ff2cd10cda0c0df33af1d286fc25af253c9e75be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2000.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <fpu_control.h>
 #include <stdio.h>
 
-int
-main (void)
+#ifndef FPU_CONTROL
+# define FPU_CONTROL _FPU_DEFAULT
+#endif
+
+static int
+do_test (void)
 {
 #ifdef _FPU_GETCW
 /* Some architectures don't have _FPU_GETCW (e.g. Linux/Alpha).  */
@@ -31,13 +34,16 @@ main (void)
 
   cw &= ~_FPU_RESERVED;
 
-  if (cw != (_FPU_DEFAULT & ~_FPU_RESERVED))
+  if (cw != (FPU_CONTROL & ~_FPU_RESERVED))
     printf ("control word is 0x%lx but should be 0x%lx.\n",
-           (long int) cw, (long int) (_FPU_DEFAULT & ~_FPU_RESERVED));
+           (long int) cw, (long int) (FPU_CONTROL & ~_FPU_RESERVED));
 
-  return cw != (_FPU_DEFAULT & ~_FPU_RESERVED);
+  return cw != (FPU_CONTROL & ~_FPU_RESERVED);
 
 #else
   return 0;
 #endif
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"