mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-10 07:10:06 +00:00
de1c3ebb59
* misc/bits/syslog.h (syslog): When __va_arg_pack is defined, implement as __extern_always_inline function. (vsyslog): Define as __extern_always_inline function unconditionally. * libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf): When __va_arg_pack is defined, implement as __extern_always_inline functions. (vsprintf, vsnprintf, vprintf, vfprintf): Define as __extern_always_inline functions unconditionally. * libio/bits/stdio.h (vprintf): Ifdef out the inline when bits/stdio2.h will be included. * wcsmbs/bits/wchar2.h (__swprintf_alias): New redirect. (swprintf, wprintf, fwprintf): When __va_arg_pack is defined, implement as __extern_always_inline functions. (vswprintf, vwprintf, vfwprintf): Define as __extern_always_inline functions unconditionally. * debug/tst-chk1.c (do_test): Enable remaining tests for C++. 2007-09-03 Jakub Jelinek <jakub@redhat.com> * misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Only define in C++ for GCC 4.3+, in C++ always use __gnu_inline__ attribute. * include/features.h (__USE_EXTERN_INLINES): Define only when __extern_inline is defined. * stdlib/stdlib.h: Include bits/stdlib.h when __extern_always_inline is defined instead of when not __cplusplus. * misc/sys/syslog.h: Include bits/syslog.h when __extern_always_inline is defined instead of when not __cplusplus. * socket/sys/socket.h: Include bits/socket2.h when __extern_always_inline is defined instead of when not __cplusplus. * libio/stdio.h: Include bits/stdio2.h when __extern_always_inline is defined instead of when not __cplusplus. * posix/unistd.h: Include bits/unistd.h when __extern_always_inline is defined instead of when not __cplusplus. * string/string.h: Include bits/string3.h when __extern_always_inline is defined instead of when not __cplusplus. * wcsmbs/wchar.h: Include bits/wchar2.h when __extern_always_inline is defined instead of when not __cplusplus. (btowc, wctob): Don't guard the inlines with ifndef __cplusplus. * io/fcntl.h: Don't include bits/fcntl2.h if __extern_always_inline is not defined. * misc/bits/syslog-ldbl.h: Guard *_chk stuff with defined __extern_always_inline instead of !defined __cplusplus. * libio/bits/stdio-ldbl.h: Likewise. * wcsmbs/bits/wchar-ldbl.h: Likewise. * misc/bits/syslog.h (syslog): Don't define for C++. (vsyslog): Use __extern_always_inline function for C++ instead of a macro. * libio/bits/stdio.h (__STDIO_INLINE): Define to __extern_inline whenever that macro is defined. (vprintf): Don't provide the inline for C++. (fread_unlocked, fwrite_unlocked): Don't define the macros for C++. * libio/bits/stdio2.h (sprintf, snprintf, printf, fprintf): Don't define the macros for C++. (vsprintf, vsnprintf, vprintf, vfprintf): Define as __extern_always_inline functions for C++. * io/sys/stat.h (stat, lstat, fstat, fstatat, mknod, mknodat, stat64, lstat64, fstat64, fstatat64): Don't define if not __USE_EXTERN_INLINES. * wcsmbs/bits/wchar2.h: Fix #error message. (swprintf, wprintf, fwprintf): Don't define the macros for C++. (vswprintf, vwprintf, vfwprintf): Define using __extern_always_inline functions for C++. * string/bits/string3.h: Don't #undef macros if __cplusplus. (memcpy, memmove, mempcpy, memset, bcopy, bzero, strcpy, stpcpy, strncpy, strcat, strncat): Define as __extern_always_inline functions instead of macros for C++. * math/bits/cmathcalls.h: Guard __extern_inline routines with defined __extern_inline. * sysdeps/alpha/fpu/bits/mathinline.h (__MATH_INLINE): Define to __extern_inline whenever that macro is defined. * sysdeps/ia64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/i386/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/i386/i486/bits/string.h (__STRING_INLINE): Likewise. * sysdeps/s390/bits/string.h (__STRING_INLINE): Likewise. * sysdeps/s390/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/powerpc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/x86_64/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/sparc/fpu/bits/mathinline.h (__MATH_INLINE): Likewise. * sysdeps/unix/sysv/linux/sys/sysmacros.h (gnu_dev_major, gnu_dev_minor, gnu_dev_makedev): Remove __extern_inline from prototypes. Only provide __extern_inline routines if __USE_EXTERN_INLINES. * debug/Makefile: Add rules to build and run tst-{,lfs}chk{4,5,6} tests. * debug/tst-chk1.c (do_prepare, do_test): Allow compilation as C++. For now avoid some *printf tests in C++. Skip all testing if __USE_FORTIFY_LEVEL is defined, but __extern_always_inline macro is not. * debug/tst-chk4.cc: New file. * debug/tst-chk5.cc: New file. * debug/tst-chk6.cc: New file. * debug/tst-lfschk4.cc: New file. * debug/tst-lfschk5.cc: New file. * debug/tst-lfschk6.cc: New file. * include/wchar.h (__vfwprintf_chk, __vswprintf_chk): Avoid prototypes in C++. * include/stdio.h (__sprintf_chk, __snprintf_chk, __vsprintf_chk, __vsnprintf_chk, __printf_chk, __fprintf_chk, __vprintf_chk, __vfprintf_chk, __fgets_unlocked_chk, __fgets_chk): Likewise. |
||
---|---|---|
.. | ||
bits | ||
machine | ||
.cvsignore | ||
atest-exp2.c | ||
atest-exp.c | ||
atest-sincos.c | ||
basic-test.c | ||
bug-nextafter.c | ||
bug-nexttoward.c | ||
bug-tgmath1.c | ||
cabs.c | ||
cabsf.c | ||
cabsl.c | ||
carg.c | ||
cargf.c | ||
cargl.c | ||
cimag.c | ||
cimagf.c | ||
cimagl.c | ||
complex.h | ||
conj.c | ||
conjf.c | ||
conjl.c | ||
creal.c | ||
crealf.c | ||
creall.c | ||
divtc3.c | ||
e_acoshl.c | ||
e_acosl.c | ||
e_asinl.c | ||
e_atan2l.c | ||
e_atanhl.c | ||
e_coshl.c | ||
e_exp2l.c | ||
e_exp10.c | ||
e_exp10f.c | ||
e_exp10l.c | ||
e_expl.c | ||
e_fmodl.c | ||
e_gammal_r.c | ||
e_hypotl.c | ||
e_j0l.c | ||
e_j1l.c | ||
e_jnl.c | ||
e_lgammal_r.c | ||
e_log2l.c | ||
e_log10l.c | ||
e_logl.c | ||
e_powl.c | ||
e_rem_pio2l.c | ||
e_scalb.c | ||
e_scalbf.c | ||
e_scalbl.c | ||
e_sinhl.c | ||
e_sqrtl.c | ||
fclrexcpt.c | ||
fedisblxcpt.c | ||
feenablxcpt.c | ||
fegetenv.c | ||
fegetexcept.c | ||
fegetround.c | ||
feholdexcpt.c | ||
fenv.h | ||
fesetenv.c | ||
fesetround.c | ||
feupdateenv.c | ||
fgetexcptflg.c | ||
fpu_control.c | ||
fraiseexcpt.c | ||
fsetexcptflg.c | ||
ftestexcept.c | ||
gen-libm-test.pl | ||
ieee-math.c | ||
k_cosl.c | ||
k_rem_pio2l.c | ||
k_sincosl.c | ||
k_sinl.c | ||
k_tanl.c | ||
libm-test.inc | ||
Makefile | ||
math_private.h | ||
math.h | ||
multc3.c | ||
README.libm-test | ||
s_asinhl.c | ||
s_atanl.c | ||
s_cacos.c | ||
s_cacosf.c | ||
s_cacosh.c | ||
s_cacoshf.c | ||
s_cacoshl.c | ||
s_cacosl.c | ||
s_casin.c | ||
s_casinf.c | ||
s_casinh.c | ||
s_casinhf.c | ||
s_casinhl.c | ||
s_casinl.c | ||
s_catan.c | ||
s_catanf.c | ||
s_catanh.c | ||
s_catanhf.c | ||
s_catanhl.c | ||
s_catanl.c | ||
s_cbrtl.c | ||
s_ccos.c | ||
s_ccosf.c | ||
s_ccosh.c | ||
s_ccoshf.c | ||
s_ccoshl.c | ||
s_ccosl.c | ||
s_cexp.c | ||
s_cexpf.c | ||
s_cexpl.c | ||
s_clog10.c | ||
s_clog10f.c | ||
s_clog10l.c | ||
s_clog.c | ||
s_clogf.c | ||
s_clogl.c | ||
s_cpow.c | ||
s_cpowf.c | ||
s_cpowl.c | ||
s_cproj.c | ||
s_cprojf.c | ||
s_cprojl.c | ||
s_csin.c | ||
s_csinf.c | ||
s_csinh.c | ||
s_csinhf.c | ||
s_csinhl.c | ||
s_csinl.c | ||
s_csqrt.c | ||
s_csqrtf.c | ||
s_csqrtl.c | ||
s_ctan.c | ||
s_ctanf.c | ||
s_ctanh.c | ||
s_ctanhf.c | ||
s_ctanhl.c | ||
s_ctanl.c | ||
s_erfl.c | ||
s_expm1l.c | ||
s_fdim.c | ||
s_fdimf.c | ||
s_fdiml.c | ||
s_fma.c | ||
s_fmaf.c | ||
s_fmal.c | ||
s_fmax.c | ||
s_fmaxf.c | ||
s_fmaxl.c | ||
s_fmin.c | ||
s_fminf.c | ||
s_fminl.c | ||
s_ldexp.c | ||
s_ldexpf.c | ||
s_ldexpl.c | ||
s_log1pl.c | ||
s_nan.c | ||
s_nanf.c | ||
s_nanl.c | ||
s_nextafter.c | ||
s_nexttowardf.c | ||
s_nexttowardl.c | ||
s_significand.c | ||
s_significandf.c | ||
s_significandl.c | ||
s_tanhl.c | ||
setfpucw.c | ||
t_sincosl.c | ||
test-double.c | ||
test-fenv.c | ||
test-float.c | ||
test-fpucw.c | ||
test-idouble.c | ||
test-ifloat.c | ||
test-ildoubl.c | ||
test-ldouble.c | ||
test-matherr.c | ||
test-misc.c | ||
test-tgmath2.c | ||
test-tgmath-int.c | ||
test-tgmath-ret.c | ||
test-tgmath.c | ||
tgmath.h | ||
tst-definitions.c | ||
Versions | ||
w_acos.c | ||
w_acosf.c | ||
w_acosh.c | ||
w_acoshf.c | ||
w_acoshl.c | ||
w_acosl.c | ||
w_asin.c | ||
w_asinf.c | ||
w_asinl.c | ||
w_atan2.c | ||
w_atan2f.c | ||
w_atan2l.c | ||
w_atanh.c | ||
w_atanhf.c | ||
w_atanhl.c | ||
w_cosh.c | ||
w_coshf.c | ||
w_coshl.c | ||
w_drem.c | ||
w_dremf.c | ||
w_dreml.c | ||
w_exp2.c | ||
w_exp2f.c | ||
w_exp2l.c | ||
w_exp10.c | ||
w_exp10f.c | ||
w_exp10l.c | ||
w_expl.c | ||
w_fmod.c | ||
w_fmodf.c | ||
w_fmodl.c | ||
w_hypot.c | ||
w_hypotf.c | ||
w_hypotl.c | ||
w_j0.c | ||
w_j0f.c | ||
w_j0l.c | ||
w_j1.c | ||
w_j1f.c | ||
w_j1l.c | ||
w_jn.c | ||
w_jnf.c | ||
w_jnl.c | ||
w_lgamma_r.c | ||
w_lgamma.c | ||
w_lgammaf_r.c | ||
w_lgammaf.c | ||
w_lgammal_r.c | ||
w_lgammal.c | ||
w_log2.c | ||
w_log2f.c | ||
w_log2l.c | ||
w_log10.c | ||
w_log10f.c | ||
w_log10l.c | ||
w_log.c | ||
w_logf.c | ||
w_logl.c | ||
w_pow.c | ||
w_powf.c | ||
w_powl.c | ||
w_remainder.c | ||
w_remainderf.c | ||
w_remainderl.c | ||
w_scalb.c | ||
w_scalbf.c | ||
w_scalbl.c | ||
w_sinh.c | ||
w_sinhf.c | ||
w_sinhl.c | ||
w_sqrt.c | ||
w_sqrtf.c | ||
w_sqrtl.c | ||
w_tgamma.c | ||
w_tgammaf.c | ||
w_tgammal.c |
README for libm-test math test suite ==================================== The libm-test math test suite tests a number of function points of math functions in the GNU C library. The following sections contain a brief overview. Please note that the test drivers and the Perl script "gen-libm-test.pl" have some options. A full list of options is available with --help (for the test drivers) and -h for "gen-libm-test.pl". What is tested? =============== The tests just evaluate the functions at specified points and compare the results with precomputed values and the requirements of the ISO C99 standard. Besides testing the special values mandated by IEEE 754 (infinities, NaNs and minus zero), some more or less random values are tested. Files that are part of libm-test ================================ The main file is "libm-test.inc". It is platform and floating point format independent. The file must be preprocessed by the Perl script "gen-libm-test.pl". The results are "libm-test.c" and a file "libm-test-ulps.h" with platform specific deltas. The test drivers test-double.c, test-float.c, test-ldouble.c test the normal double, float and long double implementation of libm. The test drivers with an i in it (test-idouble.c, test-ifloat.c, test-ildoubl.c) test the corresponding inline functions (where available - otherwise they also test the real functions in libm). "gen-libm-test.pl" needs a platform specific files with ULPs (Units of Last Precision). The file is called "libm-test-ulps" and lives in platform specific sysdep directory. How can I generate "libm-test-ulps"? ==================================== The test drivers have an option "-u" to output an unsorted list of all epsilons that the functions have. The output can be read in directly but it's better to pretty print it first. "gen-libm-test.pl" has an option to generate a pretty-printed and sorted new ULPs file from the output of the test drivers. To generate a new "libm-test-ulps" file, first remove "ULPs" file in the current directory, then you can execute for example: test-double -u --ignore-max-ulp=yes This generates a file "ULPs" with all double ULPs in it, ignoring any previous calculated ULPs. Now generate the ULPs for all other formats, the tests will be appending the data to the "ULPs" file. As final step run "gen-libm-test.pl" with the file as input and ask to generate a pretty printed output in the file "NewUlps": gen-libm-test.pl -u ULPs -n Now you can rename "NewUlps" to "libm-test-ulps" and move it into sysdeps. Contents of libm-test-ulps ========================== Since libm-test-ulps can be generated automatically, just a few notes. The file contains lines for single tests, like: Test "cos (pi/2) == 0": float: 1 and lines for maximal errors of single functions, like: Function "yn": idouble: 6.0000 The keywords are float, ifloat, double, idouble, ldouble and ildouble (the prefix i stands for inline). You can also specify known failures, e.g.: Test "cos (pi/2) == 0": float: 1 float: fail Adding tests to libm-test.inc ============================= The tests are evaluated by a set of special test macros. The macros start with "TEST_" followed by a specification the input values, an underscore and a specification of the output values. As an example, the test macro for a function with input of type FLOAT (FLOAT is either float, double, long double) and output of type FLOAT is "TEST_f_f". The macro's parameter are the name of the function, the input parameter, output parameter and optionally one exception parameter. The accepted parameter types are: - "f" for FLOAT - "b" for boolean - just tests if the output parameter evaluates to 0 or 1 (only for output). - "c" for complex. This parameter needs two values, first the real, then the imaginary part. - "i" for int. - "l" for long int. - "L" for long long int. - "F" for the address of a FLOAT (only as input parameter) - "I" for the address of an int (only as input parameter) Some functions need special handling. For example gamma sets the global variable signgam and frexp takes an argument to &int. This special treatment is coded in "gen-libm-test.pl" and used while parsing "libm-test.inc".