[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] tests/tcg/s390x: Add long-double.c
From: |
Richard Henderson |
Subject: |
[PATCH 7/9] tests/tcg/s390x: Add long-double.c |
Date: |
Fri, 21 Oct 2022 17:30:04 +1000 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/tcg/s390x/long-double.c | 24 ++++++++++++++++++++++++
tests/tcg/s390x/Makefile.target | 1 +
2 files changed, 25 insertions(+)
create mode 100644 tests/tcg/s390x/long-double.c
diff --git a/tests/tcg/s390x/long-double.c b/tests/tcg/s390x/long-double.c
new file mode 100644
index 0000000000..757a6262fd
--- /dev/null
+++ b/tests/tcg/s390x/long-double.c
@@ -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;
+}
diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target
index c830313e67..627668e1ce 100644
--- a/tests/tcg/s390x/Makefile.target
+++ b/tests/tcg/s390x/Makefile.target
@@ -17,6 +17,7 @@ TESTS+=trap
TESTS+=signals-s390x
TESTS+=branch-relative-long
TESTS+=noexec
+TESTS+=long-double
Z14_TESTS=vfminmax
vfminmax: LDFLAGS+=-lm
--
2.34.1
- Re: [PATCH 4/9] target/s390x: Use Int128 for return from CKSM, (continued)
- [PATCH 6/9] target/s390x: Copy wout_x1 to wout_x1_P, Richard Henderson, 2022/10/21
- [PATCH 2/9] target/s390x: Use a single return for helper_divs64/u64, Richard Henderson, 2022/10/21
- [PATCH 8/9] target/s390x: Use Int128 for returning float128, Richard Henderson, 2022/10/21
- [PATCH 7/9] tests/tcg/s390x: Add long-double.c,
Richard Henderson <=
- [PATCH 3/9] target/s390x: Use Int128 for return from CLST, Richard Henderson, 2022/10/21
- [PATCH 5/9] target/s390x: Use Int128 for return from TRE, Richard Henderson, 2022/10/21
- [PATCH 9/9] target/s390x: Use Int128 for passing float128, Richard Henderson, 2022/10/21