summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/ieeefp/round
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/regress/lib/libc/ieeefp/round/Makefile5
-rw-r--r--src/regress/lib/libc/ieeefp/round/round.c45
2 files changed, 0 insertions, 50 deletions
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 @@
1# $OpenBSD: Makefile,v 1.4 2002/02/18 11:25:34 art Exp $
2
3PROG= round
4
5.include <bsd.regress.mk>
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 @@
1/* $OpenBSD: round.c,v 1.3 2003/07/31 21:48:03 deraadt Exp $ */
2/* $NetBSD: round.c,v 1.1 1995/04/26 00:27:28 jtc Exp $ */
3
4/*
5 * Written by J.T. Conklin, Apr 18, 1995
6 * Public domain.
7 */
8
9#include <assert.h>
10#include <stdlib.h>
11#include <ieeefp.h>
12#include <float.h>
13
14int
15main(int argc, char *argv[])
16{
17 /*
18 * This test would be better if it actually performed some
19 * calculations to verify the selected rounding mode. But
20 * this is probably acceptable since the fp{get,set}round
21 * functions usually just get or set the processors fpu
22 * control word.
23 */
24
25 assert(fpgetround() == FP_RN);
26 assert(FLT_ROUNDS == 1);
27
28 assert(fpsetround(FP_RP) == FP_RN);
29 assert(fpgetround() == FP_RP);
30 assert(FLT_ROUNDS == 2);
31
32 assert(fpsetround(FP_RM) == FP_RP);
33 assert(fpgetround() == FP_RM);
34 assert(FLT_ROUNDS == 3);
35
36 assert(fpsetround(FP_RZ) == FP_RM);
37 assert(fpgetround() == FP_RZ);
38 assert(FLT_ROUNDS == 0);
39
40 assert(fpsetround(FP_RN) == FP_RZ);
41 assert(fpgetround() == FP_RN);
42 assert(FLT_ROUNDS == 1);
43
44 exit(0);
45}