Quick test to make sure that __infinity is properly infinite. It isn't on

ARM ELF systems at the moment.
This commit is contained in:
bjh21 2001-10-27 23:36:32 +00:00
parent 5855efa8d8
commit 2f77d1a624
3 changed files with 37 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.8 2001/03/13 08:09:15 ross Exp $
# $NetBSD: Makefile,v 1.9 2001/10/27 23:36:32 bjh21 Exp $
# Don't hook up testfloat just yet. (ross, 2001.3.12)
SUBDIR+= except round
SUBDIR+= except infinity round
.include <bsd.subdir.mk>

View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1 2001/10/27 23:36:32 bjh21 Exp $
PROG= infinity
MKMAN= no
regress: ${PROG}
./${PROG}
.include <bsd.prog.mk>

View File

@ -0,0 +1,26 @@
/* $NetBSD: infinity.c,v 1.1 2001/10/27 23:36:32 bjh21 Exp $ */
/*
* This file is in the Public Domain.
*
* Ben Harris, 2001
*/
/*
* Check that HUGE_VAL (alias __infinity) really is infinite.
* Alternatively, check that isinf() minimally works.
*/
#include <err.h>
#include <math.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
/* HUGE_VAL is meant to be an infinity. */
if (!isinf(HUGE_VAL))
errx(1, "Infinity isn't infinite");
return 0;
}