summaryrefslogtreecommitdiff
path: root/test/math/test-fpucw.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-03 13:03:55 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-03 13:03:55 +0100
commit3384c45e66ddf18f235654b67ae34ac7dcb07534 (patch)
treeedbd0f03b72acb5961f7919e13da34a34a84fc23 /test/math/test-fpucw.c
parent29d1023614fcfef8520edec8b64e9f8953d9a121 (diff)
math: sync with GNU libc
The format of the ULPS files have changed, non-glibc architecture files needs to be updated later. Add all math tests from latest GNU libc and allow to compile and run them on uClibc-ng and GNU libc systems.
Diffstat (limited to 'test/math/test-fpucw.c')
-rw-r--r--test/math/test-fpucw.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/math/test-fpucw.c b/test/math/test-fpucw.c
index 93237ea..0ea5896 100644
--- a/test/math/test-fpucw.c
+++ b/test/math/test-fpucw.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
+/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 2000.
@@ -19,8 +19,12 @@
#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). */
@@ -30,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"