lib/msun/tests: Add more debug output to fenv_test.c
Output a hex dump of the current fenv and the expected value to allow comparing them without having to resort to interactive use of GDB.
This commit is contained in:
parent
2b181156c8
commit
6ccdee8ab5
@ -86,6 +86,7 @@ IGNORE_PRAGMA=
|
|||||||
|
|
||||||
SRCS.ilogb2_test= ilogb_test.c
|
SRCS.ilogb2_test= ilogb_test.c
|
||||||
|
|
||||||
|
LIBADD.fenv_test+= util
|
||||||
LIBADD+= m
|
LIBADD+= m
|
||||||
|
|
||||||
WARNS?= 6
|
WARNS?= 6
|
||||||
|
@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <fenv.h>
|
#include <fenv.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
#include <libutil.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -173,7 +174,10 @@ ATF_TC_BODY(dfl_env, tc)
|
|||||||
fenv_t env;
|
fenv_t env;
|
||||||
|
|
||||||
fegetenv(&env);
|
fegetenv(&env);
|
||||||
|
/* Print the default environment for debugging purposes. */
|
||||||
|
hexdump(&env, sizeof(env), "current fenv ", HD_OMIT_CHARS);
|
||||||
|
hexdump(FE_DFL_ENV, sizeof(env), "default fenv ", HD_OMIT_CHARS);
|
||||||
|
CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT);
|
||||||
#ifdef __amd64__
|
#ifdef __amd64__
|
||||||
/*
|
/*
|
||||||
* Compare the fields that the AMD [1] and Intel [2] specs say will be
|
* Compare the fields that the AMD [1] and Intel [2] specs say will be
|
||||||
@ -202,7 +206,7 @@ ATF_TC_BODY(dfl_env, tc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
ATF_CHECK_EQ(0, fetestexcept(FE_ALL_EXCEPT));
|
CHECK_FP_EXCEPTIONS(0, FE_ALL_EXCEPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user