do the long double tests if we have long double.
This commit is contained in:
parent
fac93a1e7a
commit
237ae380ee
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $ */
|
||||
/* $NetBSD: t_precision.c,v 1.3 2016/08/27 10:07:05 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2013 The NetBSD Foundation, Inc.
|
||||
|
@ -29,7 +29,7 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include <sys/cdefs.h>
|
||||
__RCSID("$NetBSD: t_precision.c,v 1.2 2014/11/04 00:20:19 justin Exp $");
|
||||
__RCSID("$NetBSD: t_precision.c,v 1.3 2016/08/27 10:07:05 christos Exp $");
|
||||
|
||||
#include <atf-c.h>
|
||||
|
||||
|
@ -45,7 +45,9 @@ ATF_TC_HEAD(t_precision, tc)
|
|||
}
|
||||
|
||||
volatile double x = 1;
|
||||
#if __HAVE_LONG_DOUBLE
|
||||
volatile long double y = 1;
|
||||
#endif
|
||||
|
||||
ATF_TC_BODY(t_precision, tc)
|
||||
{
|
||||
|
@ -58,6 +60,7 @@ ATF_TC_BODY(t_precision, tc)
|
|||
x += DBL_EPSILON;
|
||||
ATF_CHECK(x == 2.0);
|
||||
|
||||
#if __HAVE_LONG_DOUBLE
|
||||
y += LDBL_EPSILON;
|
||||
ATF_CHECK(y != 1.0L);
|
||||
y -= 1;
|
||||
|
@ -65,6 +68,7 @@ ATF_TC_BODY(t_precision, tc)
|
|||
y = 2;
|
||||
y += LDBL_EPSILON;
|
||||
ATF_CHECK(y == 2.0L);
|
||||
#endif
|
||||
}
|
||||
|
||||
ATF_TP_ADD_TCS(tp)
|
||||
|
|
Loading…
Reference in New Issue