summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-11-17 20:09:59 +0000
committerotto <otto@openbsd.org>2005-11-17 20:09:59 +0000
commit57bb570d511a9164e8f5b459f4e81597f58b53a8 (patch)
tree60558ec8effb01d6f2b5720af61332a4efbc165c
parentIntroduce a few c99 functions: {l,ll}{rint,round}{,f}. From NetBSD via (diff)
downloadwireguard-openbsd-57bb570d511a9164e8f5b459f4e81597f58b53a8.tar.xz
wireguard-openbsd-57bb570d511a9164e8f5b459f4e81597f58b53a8.zip
Test a few more rint functions.
-rw-r--r--regress/lib/libm/rint/rint.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/regress/lib/libm/rint/rint.c b/regress/lib/libm/rint/rint.c
index 70388a228a4..e685152bf24 100644
--- a/regress/lib/libm/rint/rint.c
+++ b/regress/lib/libm/rint/rint.c
@@ -1,7 +1,8 @@
-/* $OpenBSD: rint.c,v 1.4 2003/09/02 23:52:17 david Exp $ */
+/* $OpenBSD: rint.c,v 1.5 2005/11/17 20:09:59 otto Exp $ */
/* Written by Michael Shalayeff, 2003, Public domain. */
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -33,7 +34,17 @@ main(int argc, char *argv[])
sigaction(SIGFPE, &sa, NULL);
if (rint(8.6) != 9.)
- exit(1);
+ err(1, "rint");
+ if (rintf(8.6F) != 9)
+ err(1, "rintf");
+ if (lrint(8.6) != 9L)
+ err(1, "lrint");
+ if (lrintf(8.6F) != 9L)
+ err(1, "lrintf");
+ if (llrint(8.6) != 9LL)
+ err(1, "llrint");
+ if (llrintf(8.6F) != 9LL)
+ err(1, "llrintf");
exit(0);
}