From eb8dd9dca1228af0cd132f515509051ecfabf6f6 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Mon, 14 Apr 2025 17:32:06 +0000 Subject: This commit was manufactured by cvs2git to create tag 'tb_20250414'. --- src/regress/lib/libc/ieeefp/Makefile | 8 -- src/regress/lib/libc/ieeefp/except/Makefile | 24 ------ src/regress/lib/libc/ieeefp/except/except.c | 110 ------------------------ src/regress/lib/libc/ieeefp/inf/Makefile | 9 -- src/regress/lib/libc/ieeefp/inf/inf.c | 16 ---- src/regress/lib/libc/ieeefp/infinity/Makefile | 22 ----- src/regress/lib/libc/ieeefp/infinity/infinity.c | 77 ----------------- src/regress/lib/libc/ieeefp/round/Makefile | 5 -- src/regress/lib/libc/ieeefp/round/round.c | 45 ---------- 9 files changed, 316 deletions(-) delete mode 100644 src/regress/lib/libc/ieeefp/Makefile delete mode 100644 src/regress/lib/libc/ieeefp/except/Makefile delete mode 100644 src/regress/lib/libc/ieeefp/except/except.c delete mode 100644 src/regress/lib/libc/ieeefp/inf/Makefile delete mode 100644 src/regress/lib/libc/ieeefp/inf/inf.c delete mode 100644 src/regress/lib/libc/ieeefp/infinity/Makefile delete mode 100644 src/regress/lib/libc/ieeefp/infinity/infinity.c delete mode 100644 src/regress/lib/libc/ieeefp/round/Makefile delete mode 100644 src/regress/lib/libc/ieeefp/round/round.c (limited to 'src/regress/lib/libc/ieeefp') diff --git a/src/regress/lib/libc/ieeefp/Makefile b/src/regress/lib/libc/ieeefp/Makefile deleted file mode 100644 index 89ff51a2e7..0000000000 --- a/src/regress/lib/libc/ieeefp/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $OpenBSD: Makefile,v 1.6 2004/01/15 18:53:23 miod Exp $ -# $NetBSD: Makefile,v 1.5 1996/04/09 16:54:18 phil Exp $ - -SUBDIR+= except inf infinity round - -install: - -.include diff --git a/src/regress/lib/libc/ieeefp/except/Makefile b/src/regress/lib/libc/ieeefp/except/Makefile deleted file mode 100644 index 0a16eb762e..0000000000 --- a/src/regress/lib/libc/ieeefp/except/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# $OpenBSD: Makefile,v 1.7 2021/06/17 12:55:38 kettenis Exp $ - -PROG=except - -REGRESS_TARGETS+= fltdiv fltinv fltovf fltund - -.if ${MACHINE} == arm64 || ${MACHINE} == armv7 || ${MACHINE} == riscv64 -# Floating-point exceptions are optional and absent on most hardware -REGRESS_EXPECTED_FAILURES+= fltdiv fltinv fltovf fltund -.endif - -fltdiv: ${PROG} - ./${PROG} fltdiv - -fltinv: ${PROG} - ./${PROG} fltinv - -fltovf: ${PROG} - ./${PROG} fltovf - -fltund: ${PROG} - ./${PROG} fltund - -.include diff --git a/src/regress/lib/libc/ieeefp/except/except.c b/src/regress/lib/libc/ieeefp/except/except.c deleted file mode 100644 index cc3dcf8e44..0000000000 --- a/src/regress/lib/libc/ieeefp/except/except.c +++ /dev/null @@ -1,110 +0,0 @@ -/* $OpenBSD: except.c,v 1.12 2010/05/08 19:16:33 naddy Exp $ */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -volatile sig_atomic_t signal_status; - -volatile const double one = 1.0; -volatile const double zero = 0.0; -volatile const double huge = DBL_MAX; -volatile const double tiny = DBL_MIN; - -void -sigfpe(int sig, siginfo_t *si, void *v) -{ - char buf[132]; - - if (si) { - snprintf(buf, sizeof(buf), "sigfpe: addr=%p, code=%d\n", - si->si_addr, si->si_code); - write(1, buf, strlen(buf)); - } - _exit(signal_status); -} - - -int -main(int argc, char *argv[]) -{ - struct sigaction sa; - volatile double x; - - if (argc != 2) { - fprintf(stderr, "usage: %s condition\n", argv[0]); - exit(1); - } - - /* - * check to make sure that all exceptions are masked and - * that the accumulated exception status is clear. - */ - assert(fpgetmask() == 0); - assert(fpgetsticky() == 0); - - memset(&sa, 0, sizeof(sa)); - sa.sa_sigaction = sigfpe; - sa.sa_flags = SA_SIGINFO; - sigaction(SIGFPE, &sa, NULL); - signal_status = 1; - - if (strcmp(argv[1], "fltdiv") == 0) { - /* trip divide by zero */ - x = one / zero; - assert(fpgetsticky() & FP_X_DZ); - fpsetsticky(0); - - /* and now unmask to get a signal */ - signal_status = 0; - fpsetmask(FP_X_DZ); - x = one / zero; - } else if (strcmp(argv[1], "fltinv") == 0) { - /* trip invalid operation */ - x = zero / zero; - assert(fpgetsticky() & FP_X_INV); - fpsetsticky(0); - - /* and now unmask to get a signal */ - signal_status = 0; - fpsetmask(FP_X_INV); - x = zero / zero; - } else if (strcmp(argv[1], "fltovf") == 0) { - /* trip overflow */ - x = huge * huge; - assert(fpgetsticky() & FP_X_OFL); - fpsetsticky(0); - - /* and now unmask to get a signal */ - signal_status = 0; - fpsetmask(FP_X_OFL); - x = huge * huge; - } else if (strcmp(argv[1], "fltund") == 0) { - /* trip underflow */ - x = tiny * tiny; - assert(fpgetsticky() & FP_X_UFL); - fpsetsticky(0); - - /* and now unmask to get a signal */ - signal_status = 0; - fpsetmask(FP_X_UFL); - x = tiny * tiny; - } else { - errx(1, "unrecognized condition %s", argv[1]); - } - - /* - * attempt to trigger the exception on machines where - * floating-point exceptions are deferred. - */ - x = one * one; - - errx(1, "signal wasn't caught"); -} diff --git a/src/regress/lib/libc/ieeefp/inf/Makefile b/src/regress/lib/libc/ieeefp/inf/Makefile deleted file mode 100644 index b9a50e0ce6..0000000000 --- a/src/regress/lib/libc/ieeefp/inf/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2002/02/16 17:22:16 pvalchev Exp $ - -PROG= inf -SRCS= inf.c - -LDADD+= -lm -DPADD+= ${LIBM} - -.include diff --git a/src/regress/lib/libc/ieeefp/inf/inf.c b/src/regress/lib/libc/ieeefp/inf/inf.c deleted file mode 100644 index a1956145a6..0000000000 --- a/src/regress/lib/libc/ieeefp/inf/inf.c +++ /dev/null @@ -1,16 +0,0 @@ -/* $OpenBSD: inf.c,v 1.3 2003/07/31 21:48:03 deraadt Exp $ */ - -/* - * Peter Valchev Public Domain, 2002. - */ - -#include - -int -main(int argc, char *argv[]) -{ - if (isinf(HUGE_VAL)) - return 0; - - return 1; -} diff --git a/src/regress/lib/libc/ieeefp/infinity/Makefile b/src/regress/lib/libc/ieeefp/infinity/Makefile deleted file mode 100644 index ac102d8a63..0000000000 --- a/src/regress/lib/libc/ieeefp/infinity/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2004/01/16 19:34:37 miod Exp $ - -PROG= infinity - -DPADD+= ${LIBM} -LDADD+= -lm - -REGRESS_TARGETS+= add mult neg pumpkin - -add: ${PROG} - ./${PROG} -a - -mult: ${PROG} - ./${PROG} -m - -neg: ${PROG} - ./${PROG} -n - -pumpkin: ${PROG} - ./${PROG} -p - -.include diff --git a/src/regress/lib/libc/ieeefp/infinity/infinity.c b/src/regress/lib/libc/ieeefp/infinity/infinity.c deleted file mode 100644 index 3b1b71ec90..0000000000 --- a/src/regress/lib/libc/ieeefp/infinity/infinity.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $OpenBSD: infinity.c,v 1.2 2004/01/16 19:34:37 miod Exp $ */ -/* - * Written by Miodrag Vallat, 2004 - Public Domain - * Inspired from Perl's t/op/arith test #134 - */ - -#include -#include -#include - -void -sigfpe(int signum) -{ - /* looks like we don't handle fp overflow correctly... */ - _exit(1); -} - -int -main(int argc, char *argv[]) -{ - int opt; - double d, two; - int i; - char method = 'a'; - - while ((opt = getopt(argc, argv, "amnp")) != -1) - method = (char)opt; - - signal(SIGFPE, sigfpe); - - switch (method) { - case 'a': - /* try to produce +Inf through addition */ - d = 1.0; - for (i = 2000; i != 0; i--) { - d = d + d; - } - /* result should be _positive_ infinity */ - if (!isinf(d) || copysign(1.0, d) < 0.0) - return (1); - break; - case 'm': - /* try to produce +Inf through multiplication */ - d = 1.0; - two = 2.0; - for (i = 2000; i != 0; i--) { - d = d * two; - } - /* result should be _positive_ infinity */ - if (!isinf(d) || copysign(1.0, d) < 0.0) - return (1); - break; - case 'n': - /* try to produce -Inf through subtraction */ - d = -1.0; - for (i = 2000; i != 0; i--) { - d = d + d; - } - /* result should be _negative_ infinity */ - if (!isinf(d) || copysign(1.0, d) > 0.0) - return (1); - break; - case 'p': - /* try to produce -Inf through multiplication */ - d = -1.0; - two = 2.0; - for (i = 2000; i != 0; i--) { - d = d * two; - } - /* result should be _negative_ infinity */ - if (!isinf(d) || copysign(1.0, d) > 0.0) - return (1); - break; - } - - return (0); -} diff --git a/src/regress/lib/libc/ieeefp/round/Makefile b/src/regress/lib/libc/ieeefp/round/Makefile deleted file mode 100644 index 9ea6dd8c39..0000000000 --- a/src/regress/lib/libc/ieeefp/round/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.4 2002/02/18 11:25:34 art Exp $ - -PROG= round - -.include diff --git a/src/regress/lib/libc/ieeefp/round/round.c b/src/regress/lib/libc/ieeefp/round/round.c deleted file mode 100644 index 807941ea56..0000000000 --- a/src/regress/lib/libc/ieeefp/round/round.c +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: round.c,v 1.3 2003/07/31 21:48:03 deraadt Exp $ */ -/* $NetBSD: round.c,v 1.1 1995/04/26 00:27:28 jtc Exp $ */ - -/* - * Written by J.T. Conklin, Apr 18, 1995 - * Public domain. - */ - -#include -#include -#include -#include - -int -main(int argc, char *argv[]) -{ - /* - * This test would be better if it actually performed some - * calculations to verify the selected rounding mode. But - * this is probably acceptable since the fp{get,set}round - * functions usually just get or set the processors fpu - * control word. - */ - - assert(fpgetround() == FP_RN); - assert(FLT_ROUNDS == 1); - - assert(fpsetround(FP_RP) == FP_RN); - assert(fpgetround() == FP_RP); - assert(FLT_ROUNDS == 2); - - assert(fpsetround(FP_RM) == FP_RP); - assert(fpgetround() == FP_RM); - assert(FLT_ROUNDS == 3); - - assert(fpsetround(FP_RZ) == FP_RM); - assert(fpgetround() == FP_RZ); - assert(FLT_ROUNDS == 0); - - assert(fpsetround(FP_RN) == FP_RZ); - assert(fpgetround() == FP_RN); - assert(FLT_ROUNDS == 1); - - exit(0); -} -- cgit v1.2.3-55-g6feb