mirror of https://github.com/xemu-project/xemu.git
tests/tcg/s390x: Add long-double.c
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c432198ab0
commit
521d38ec9b
|
@ -26,6 +26,7 @@ TESTS+=branch-relative-long
|
||||||
TESTS+=noexec
|
TESTS+=noexec
|
||||||
TESTS+=div
|
TESTS+=div
|
||||||
TESTS+=clst
|
TESTS+=clst
|
||||||
|
TESTS+=long-double
|
||||||
|
|
||||||
Z13_TESTS=vistr
|
Z13_TESTS=vistr
|
||||||
$(Z13_TESTS): CFLAGS+=-march=z13 -O2
|
$(Z13_TESTS): CFLAGS+=-march=z13 -O2
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
/*
|
||||||
|
* Perform some basic arithmetic with long double, as a sanity check.
|
||||||
|
* With small integral numbers, we can cross-check with integers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
for (i = 1; i < 5; i++) {
|
||||||
|
for (j = 1; j < 5; j++) {
|
||||||
|
long double la = (long double)i + j;
|
||||||
|
long double lm = (long double)i * j;
|
||||||
|
long double ls = (long double)i - j;
|
||||||
|
|
||||||
|
assert(la == i + j);
|
||||||
|
assert(lm == i * j);
|
||||||
|
assert(ls == i - j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue