Martin Storsjö
9be66e9d22
crt-test: Fix the macros for avoiding compiler optimizations
...
The macros F() and L() etc were meant for providing constants for
the tests, without the compiler seeing them as constants, to
avoid optimizing out the entire functions that are to be tested.
However in practice, the compiler is also able to optimize out
e.g. a call to strtol("42", NULL, 0), so this didn't have the
intended effect.
Instead make the macros wrap through a no-op function, but which
is indirected via a global function pointer. The compiler can't
reason about global variables keeping their values (they could be
modified by e.g. a constructor in a different object file, before
running the main function). This avoids needing to pass all values
through strtod/strtol etc.
Change some constants like 123456789012345, which are seen by
the compiler as integer constants (which aren't exactly representable
in floating point form) into 123456789012345.0, which the compiler
won't complain about being inexact.
2022-10-14 14:33:51 +03:00
Martin Storsjö
83422b6be4
test: crt-test: Add tests for a bunch of string functions
...
These are functions that, when built with "-D_FORTIFY_SOURCE=2 -O2",
can end up calling the corresponding __<func>_chk functions - thus,
this can be used for testing those functions.
2022-09-16 19:44:32 +03:00
Martin Storsjö
1d8c107d49
test: crt-test: Skip a test for cos(-NAN) == -NAN when optimizing
...
Both GCC and Clang fail this test if optimizations are enabled.
2022-09-16 19:43:40 +03:00
Martin Storsjö
77d293e95f
test: Add tests for conversions between int128 and floats
...
These require a newer version of LLVM, past
d6216e2cd1a5e07f8509215ee5422ff5ee358da8 in llvm-project (September
29th).
2022-02-09 14:02:20 +02:00
Martin Storsjö
fe57d608de
test: Add tests for conversion between 64 bit integers and long double
2021-10-14 12:34:00 +03:00
Martin Storsjö
b7c5fc5ef0
test: Add tests for _bittest* intrinsics
2021-08-09 12:08:16 +03:00
Martin Storsjö
5070c39532
test: Add testing of more float formatting cases, including %a
2021-08-09 12:08:16 +03:00
Martin Storsjö
50fb2ef45d
test: Add tests for printf formatting of %+u (and %+<n>[doux])
2021-08-09 12:08:16 +03:00
Martin Storsjö
cf18e2de01
test: Add tests for strtod/strtof/strtold/wcstod/wcstof/wcstold
2021-08-09 12:08:16 +03:00
Martin Storsjö
ea4f925038
test: Add a test for printf formatting of long doubles
2021-08-09 12:08:16 +03:00
Martin Storsjö
1f5a7e0577
test: Remove a workaround for older wine versions
...
I've updated my continuous test setup to a newer version of wine now,
not needing this workaround.
2021-08-03 11:36:12 +03:00
Martin Storsjö
e5612ac52e
crt-test: Add a few more log2 tests for negative outputs with exact inputs
2020-11-21 21:34:50 +02:00
Martin Storsjö
6ae2bfa3ad
crt-test: Add a testcase for a case where a broken optimization in LLVM broke the compiler builtin division helpers
...
https://reviews.llvm.org/D88783 caused this to break.
2020-10-12 14:20:49 +03:00
Martin Storsjö
4e9072aef0
crt-test: Add tests for large values in functions that do rounding and similar operations
...
Some of these functions earlier were using integer intermediates,
where the range easily is exhausted.
2019-12-20 09:38:32 +02:00
Martin Storsjö
7f7d2f9852
crt-test: Add tests for sscanf with double/long double outputs
2019-12-20 09:38:32 +02:00
Martin Storsjö
00edbd4ec3
crt-test: Test negative zero in a few places
2019-08-01 22:30:45 +03:00
Martin Storsjö
f07f6b71fe
crt-test: Add tests for many more math functions
...
This should complete the coverage of all the C99 math functions.
2019-08-01 22:30:45 +03:00
Martin Storsjö
e9da355304
crt-test: Test the copysign function on any platform, not only on windows
2019-08-01 22:30:45 +03:00
Martin Storsjö
7347d257ed
crt-test: More thoroughly test some math functions
...
Also check that NaN is propagated properly where possible.
2019-08-01 22:30:45 +03:00
Martin Storsjö
52e7fff7a6
crt-test: Reduce code duplication in tests for math functions
2019-08-01 22:30:45 +03:00
Martin Storsjö
8eea910f47
crt-test: Extend existing tests for NAN to check that input NANs are preserved
...
Don't check the full NAN in itself, but check that the sign bit appears
correctly.
2019-08-01 22:30:45 +03:00
Martin Storsjö
2e6fa5bca7
crt-test: Wrap parameter expansion in TEST macros in parentheses
2019-08-01 22:30:45 +03:00
Martin Storsjö
70f074b599
crt-test: Restore the rounding direction after testing it
2019-08-01 22:30:45 +03:00
Martin Storsjö
c3a16814bd
crt-test: Add tests for logb/ilogb
2019-04-29 12:17:07 +03:00
Martin Storsjö
566d1dece9
crt-test: Clarify a comment further
2019-04-29 12:16:02 +03:00
Martin Storsjö
7e74b87a29
crt-test: Remove workarounds for llrint rounding to even numbers
...
Also add testcases for the same case with other functions.
2019-04-20 07:37:11 +03:00
Martin Storsjö
306b98716b
crt-test: Test powl on arm/aarch64 now
2019-04-20 07:37:11 +03:00
Martin Storsjö
fd74ad4c52
crt-test: Remove a workaround for mingw math functions
2019-04-20 07:37:11 +03:00
Martin Storsjö
8cbdd0c9b4
crt-test: Clarify a comment about a workaround
2019-04-18 22:40:35 +03:00
Martin Storsjö
86e0b3732f
crt-test: Remove skips for acosh(infinity) on x86 mingw
...
This is fixed in the latest upstream version.
2019-04-16 14:53:54 +03:00
Martin Storsjö
cb7feea731
crt-test: Tweak TEST_FLT_ACCURACY to not accept NAN
2019-04-16 10:28:43 +03:00
Martin Storsjö
70c64e58c9
crt-test: Add tests for acosh/asinh/atanh
2019-04-16 10:28:43 +03:00
Martin Storsjö
141027d5d4
crt-test: Add tests for expm1 and log1p
2019-04-16 10:28:33 +03:00
Martin Storsjö
34cf84fa68
crt-test: Test putenv and the environ variable
2019-04-15 14:05:46 +03:00
Martin Storsjö
fd39855471
crt-test: Remove a skip for fmodl on arm
2019-04-15 14:05:46 +03:00
Martin Storsjö
a59b98bb0c
crt-test: Test error reporting of CRT functions via errno
2019-04-15 14:05:46 +03:00
Martin Storsjö
62869c798c
crt-test: Remove a skip for a floor function issue
...
When using the floor function from msvcrt/ucrt instead of a libmingwex
reimplementation, this test passes on arm as well.
2019-04-15 14:05:46 +03:00
Martin Storsjö
a96783ee46
crt-test: Improve the tests for fmod/remainder/remquo
2019-04-09 14:20:23 +03:00
Martin Storsjö
776b1f4a84
crt-test: Add tests for modf
2019-04-09 13:17:06 +03:00
Martin Storsjö
3ccaf1c1bf
crt-test: Add tests of fmod/remainder/remquo
2019-04-09 12:47:00 +03:00
Martin Storsjö
cb71dfa03b
crt-test: Test sincos()
2019-04-09 12:45:35 +03:00
Martin Storsjö
5d969f2a70
crt-test: Add tests of ldexp/scalbn/scalbln
2019-04-09 12:32:56 +03:00
Martin Storsjö
dde687f36d
crt-test: Add tests of exp2
2019-04-09 12:32:56 +03:00
Martin Storsjö
f2f68dff90
crt-test: Add testcases of log2l
2019-04-09 12:32:56 +03:00
Martin Storsjö
024d125611
test: Test the now fixed copysignl function on x86_64 as well
2018-06-04 10:08:47 +03:00
Martin Storsjö
6a3080fa58
test: More clearly print errors in the NAN tests
2018-06-04 10:08:47 +03:00
Martin Storsjö
0e86b1ed49
test: Extend the intrinsics tests
2018-06-04 10:08:47 +03:00
Martin Storsjö
cacdf723fa
Add ISC licenses to the test programs
2018-03-21 11:09:55 +02:00
Martin Storsjö
7297bb65a5
Add a more thorough test case, testing various CRT features
...
Simplify building of the test cases at the same time; stop building
hello-cpp with -fno-exceptions.
2018-03-20 12:00:56 +02:00