aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMarius Hillenbrand <mhillen@linux.ibm.com>2020-12-01 11:05:42 +0100
committerAndreas Krebbel <krebbel@linux.ibm.com>2020-12-01 11:29:09 +0100
commit55419d8730e4b3cedea318c18d5a69ba0219bda0 (patch)
tree3a06e72a7a51e64dead494016cac5410a6a573f5 /gcc
parenta5dd6b69fcbe74c02d4821ac2daf2b8c9f819f6e (diff)
downloadgcc-55419d8730e4b3cedea318c18d5a69ba0219bda0.zip
gcc-55419d8730e4b3cedea318c18d5a69ba0219bda0.tar.gz
gcc-55419d8730e4b3cedea318c18d5a69ba0219bda0.tar.bz2
gcc/testsuite/s390: Add test cases for float_t
Add two test cases that check for acceptable combinations of float_t and FLT_EVAL_METHOD on s390x. Tested against an as-is glibc and one modified so that it derives float_t from FLT_EVAL_METHOD. gcc/testsuite/ChangeLog: 2020-12-01 Marius Hillenbrand <mhillen@linux.ibm.com> * gcc.target/s390/float_t-1.c: New test. * gcc.target/s390/float_t-2.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.target/s390/float_t-1.c15
-rw-r--r--gcc/testsuite/gcc.target/s390/float_t-2.c13
2 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/s390/float_t-1.c b/gcc/testsuite/gcc.target/s390/float_t-1.c
new file mode 100644
index 0000000..3455694
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/float_t-1.c
@@ -0,0 +1,15 @@
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ /* In standard-compliant mode, the size of float_t and FLT_EVAL_METHOD must
+ match. */
+ if (sizeof(float_t) == sizeof(double) && __FLT_EVAL_METHOD__ != 1)
+ abort();
+ if (sizeof(float_t) == sizeof(float) && __FLT_EVAL_METHOD__ != 0)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/s390/float_t-2.c b/gcc/testsuite/gcc.target/s390/float_t-2.c
new file mode 100644
index 0000000..ebeda28
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/float_t-2.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+#include <math.h>
+#include <stdlib.h>
+
+int main()
+{
+ /* In gnuXY mode, the size of float_t and FLT_EVAL_METHOD must
+ match, with the historic exception of permitting double and 0. */
+ if (sizeof(float_t) == sizeof(float) && __FLT_EVAL_METHOD__ == 1)
+ abort();
+ return 0;
+}