From d805d82f2058fbaccdd2a137a2f4fead1fe18229 Mon Sep 17 00:00:00 2001 From: kleink Date: Fri, 24 Oct 2003 15:54:46 +0000 Subject: [PATCH] Make this test the currently libc-internal isnanl() as well. While I'm here, turn these into assert(3)-based tests. --- regress/lib/libc/ieeefp/nan/Makefile | 6 +++++- regress/lib/libc/ieeefp/nan/nan.c | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/regress/lib/libc/ieeefp/nan/Makefile b/regress/lib/libc/ieeefp/nan/Makefile index 92ef41e25c10..be1fa5ec7031 100644 --- a/regress/lib/libc/ieeefp/nan/Makefile +++ b/regress/lib/libc/ieeefp/nan/Makefile @@ -1,9 +1,13 @@ -# $NetBSD: Makefile,v 1.3 2002/09/18 05:41:39 lukem Exp $ +# $NetBSD: Makefile,v 1.4 2003/10/24 15:54:46 kleink Exp $ NOMAN= # defined PROG= nan +# the next two lines are required for _isnanl(), which is internal to libc +CPPFLAGS+= -I${NETBSDSRCDIR}/lib/libc/include +CPPFLAGS+= -D_LIBC + regress: ${PROG} ./${PROG} diff --git a/regress/lib/libc/ieeefp/nan/nan.c b/regress/lib/libc/ieeefp/nan/nan.c index 181674cb883e..73b3cf4a69b0 100644 --- a/regress/lib/libc/ieeefp/nan/nan.c +++ b/regress/lib/libc/ieeefp/nan/nan.c @@ -1,4 +1,4 @@ -/* $NetBSD: nan.c,v 1.2 2003/10/22 23:57:04 kleink Exp $ */ +/* $NetBSD: nan.c,v 1.3 2003/10/24 15:54:46 kleink Exp $ */ /* * This file is in the Public Domain. @@ -10,19 +10,19 @@ /* * Check that NAN (alias __nanf) really is not-a-number. - * Alternatively, check that isnan() minimally works. + * Alternatively, check that isnan() and _isnanl() minimally work. */ -#include +#include "namespace.h" +#include #include -#include int main(int argc, char **argv) { /* NAN is meant to be a NaN. */ - if (!isnan(NAN)) - errx(1, "NAN is a number"); + assert(isnan(NAN)); + assert(_isnanl(NAN)); return 0; }