Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen use _FLOAT_IEEE754 instead of vax.



details:   https://anonhg.NetBSD.org/src/rev/24a6f6843f43
branches:  trunk
changeset: 770039:24a6f6843f43
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 01 17:46:10 2011 +0000

description:
use _FLOAT_IEEE754 instead of vax.

diffstat:

 tests/lib/libc/gen/t_fpclassify.c |  12 ++++++------
 tests/lib/libc/gen/t_fpsetmask.c  |  10 +++++-----
 tests/lib/libc/gen/t_fpsetround.c |  16 ++++++++--------
 tests/lib/libc/gen/t_siginfo.c    |   9 +++++----
 4 files changed, 24 insertions(+), 23 deletions(-)

diffs (194 lines):

diff -r 0f1c419d33e9 -r 24a6f6843f43 tests/lib/libc/gen/t_fpclassify.c
--- a/tests/lib/libc/gen/t_fpclassify.c Sat Oct 01 17:39:14 2011 +0000
+++ b/tests/lib/libc/gen/t_fpclassify.c Sat Oct 01 17:46:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpclassify.c,v 1.1 2011/09/19 05:25:50 jruoho Exp $ */
+/* $NetBSD: t_fpclassify.c,v 1.2 2011/10/01 17:46:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#if defined(__vax__)
+#ifndef _FLOAT_IEE754
 
 ATF_TC(no_test);
 ATF_TC_HEAD(no_test, tc)
@@ -46,7 +46,7 @@
        atf_tc_skip("Test not available on this architecture");
 }
 
-#else /* defined(__vax__) */
+#else /* defined(_FLOAT_IEEE754) */
 
 ATF_TC(fpclassify_float);
 ATF_TC_HEAD(fpclassify_float, tc)
@@ -187,12 +187,12 @@
        ATF_REQUIRE_EQ(f, 0);
 }
 #endif /* TEST_LONG_DOUBLE */
-#endif /* defined(__vax__) */
+#endif /* _FLOAT_IEEE754 */
 
 ATF_TP_ADD_TCS(tp)
 {
 
-#if defined(__vax__)
+#ifndef _FLOAT_IEEE754
        ATF_TP_ADD_TC(tp, no_test);
 #else
        ATF_TP_ADD_TC(tp, fpclassify_float);
@@ -200,7 +200,7 @@
 #ifdef TEST_LONG_DOUBLE
        ATF_TP_ADD_TC(tp, fpclassify_long_double);
 #endif /* TEST_LONG_DOUBLE */
-#endif
+#endif /* _FLOAT_IEEE754 */
 
        return atf_no_error();
 }
diff -r 0f1c419d33e9 -r 24a6f6843f43 tests/lib/libc/gen/t_fpsetmask.c
--- a/tests/lib/libc/gen/t_fpsetmask.c  Sat Oct 01 17:39:14 2011 +0000
+++ b/tests/lib/libc/gen/t_fpsetmask.c  Sat Oct 01 17:46:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_fpsetmask.c,v 1.1 2011/09/19 05:25:50 jruoho Exp $ */
+/*     $NetBSD: t_fpsetmask.c,v 1.2 2011/10/01 17:46:10 christos Exp $ */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#if defined(__mc68000__) || defined(__vax__)
+#ifndef _FLOAT_IEEE754
 
 ATF_TC(no_test);
 ATF_TC_HEAD(no_test, tc)
@@ -50,7 +50,7 @@
        atf_tc_skip("Test not available on this architecture.");
 }
 
-#else /* defined(__mc68000__) || defined(__vax__) */
+#else /* defined(_FLOAT_IEEE754) */
 
 #include <ieeefp.h>
 
@@ -310,12 +310,12 @@
 TEST(fpsetmask_unmasked, double)
 TEST(fpsetmask_unmasked, long_double)
 
-#endif /* defined(__mc68000__) || defined(__vax__) */
+#endif /* defined(_FLOAT_IEEE754) */
 
 ATF_TP_ADD_TCS(tp)
 {
 
-#if defined(__mc68000__) || defined(__vax__)
+#ifndef _FLOAT_IEEE754
        ATF_TP_ADD_TC(tp, no_test);
 #else
        ATF_TP_ADD_TC(tp, fpsetmask_masked_float);
diff -r 0f1c419d33e9 -r 24a6f6843f43 tests/lib/libc/gen/t_fpsetround.c
--- a/tests/lib/libc/gen/t_fpsetround.c Sat Oct 01 17:39:14 2011 +0000
+++ b/tests/lib/libc/gen/t_fpsetround.c Sat Oct 01 17:46:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_fpsetround.c,v 1.5 2011/09/30 23:51:50 christos Exp $ */
+/* $NetBSD: t_fpsetround.c,v 1.6 2011/10/01 17:46:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_fpsetround.c,v 1.5 2011/09/30 23:51:50 christos Exp $");
+__RCSID("$NetBSD: t_fpsetround.c,v 1.6 2011/10/01 17:46:10 christos Exp $");
 
 #include <float.h>
 #include <math.h>
@@ -44,10 +44,6 @@
 #include <string.h>
 #include <stdio.h>
 
-#if !defined(__mc68000__) && !defined(__vax__)
-#include <ieeefp.h>
-#endif
-
 #include <atf-c.h>
 
 ATF_TC(fpsetround_basic);
@@ -58,6 +54,9 @@
            "Minimal testing of fpgetround(3) and fpsetround(3)");
 }
 
+#ifdef _FLOAT_IEEE754
+#include <ieeefp.h>
+
 static const struct {
        const char *n;
        int rm;
@@ -116,12 +115,13 @@
                }
        }
 }
+#endif
 
 
 ATF_TC_BODY(fpsetround_basic, tc)
 {
 
-#if defined(__mc68000__) || defined(__vax__)
+#ifndef _FLOAT_IEEE754
        atf_tc_skip("Test not applicable on this architecture.");
 #else
        int r;
@@ -151,7 +151,7 @@
                            rnd[j].rf, r);
                test(r);
        }
-#endif /* defined(__mc68000__) || defined(__vax__) */
+#endif /* _FLOAT_IEEE754 */
 }
 
 ATF_TP_ADD_TCS(tp)
diff -r 0f1c419d33e9 -r 24a6f6843f43 tests/lib/libc/gen/t_siginfo.c
--- a/tests/lib/libc/gen/t_siginfo.c    Sat Oct 01 17:39:14 2011 +0000
+++ b/tests/lib/libc/gen/t_siginfo.c    Sat Oct 01 17:46:10 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_siginfo.c,v 1.11 2011/05/24 15:20:37 joerg Exp $ */
+/* $NetBSD: t_siginfo.c,v 1.12 2011/10/01 17:46:10 christos Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -42,8 +42,9 @@
 #include <string.h>
 #include <unistd.h>
 #include <setjmp.h>
+#include <float.h>
 
-#ifndef __vax__
+#ifdef _FLOAT_IEEE754
 #include <ieeefp.h>
 #endif
 
@@ -311,7 +312,7 @@
                sa.sa_sigaction = sigfpe_flt_action;
                sigemptyset(&sa.sa_mask);
                sigaction(SIGFPE, &sa, NULL);
-#ifndef __vax__
+#ifdef _FLOAT_IEEE754
                fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
 #endif
                printf("%g\n", 1 / d);
@@ -362,7 +363,7 @@
                sa.sa_sigaction = sigfpe_int_action;
                sigemptyset(&sa.sa_mask);
                sigaction(SIGFPE, &sa, NULL);
-#ifndef __vax__
+#ifdef _FLOAT_IEEE754
                fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
 #endif
                printf("%ld\n", 1 / l);



Home | Main Index | Thread Index | Old Index