From 84da39ce04778e1d34709bc5e46ee8f5ee10ff57 Mon Sep 17 00:00:00 2001 From: das Date: Mon, 14 Jan 2008 02:18:00 +0000 Subject: Tests for lrintl() and llrintl(). I didn't add anything specially tailored for the long double format; instead, I just modified the existing tests to test lrintl() and llrintl() as well. --- tools/regression/lib/msun/test-lrint.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/regression/lib/msun/test-lrint.c b/tools/regression/lib/msun/test-lrint.c index 44bcee7..1693a34a 100644 --- a/tools/regression/lib/msun/test-lrint.c +++ b/tools/regression/lib/msun/test-lrint.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2008 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __i386__ +#include +#endif + #define test(func, x, result, excepts) do { \ assert(feclearexcept(FE_ALL_EXCEPT) == 0); \ assert((func)(x) == (result) || fetestexcept(FE_INVALID)); \ @@ -46,20 +50,20 @@ __FBSDID("$FreeBSD$"); #define testall(x, result, excepts) do { \ test(lrint, x, result, excepts); \ test(lrintf, x, result, excepts); \ + test(lrintl, x, result, excepts); \ test(llrint, x, result, excepts); \ test(llrintf, x, result, excepts); \ + test(llrintl, x, result, excepts); \ } while (0) #define IGNORE 0 #pragma STDC FENV_ACCESS ON -int -main(int argc, char *argv[]) +void +run_tests(void) { - printf("1..1\n"); - assert(fesetround(FE_DOWNWARD) == 0); testall(0.75, 0, FE_INEXACT); testall(-0.5, -1, FE_INEXACT); @@ -120,6 +124,19 @@ main(int argc, char *argv[]) #else #error "Unsupported long long size" #endif +} + +int +main(int argc, char *argv[]) +{ + + printf("1..1\n"); + + run_tests(); +#ifdef __i386__ + fpsetprec(FP_PE); + run_tests(); +#endif printf("ok 1 - lrint\n"); -- cgit v1.1