From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from oc3353602072.ibm.com (110-221-018-212.ip-addr.vsenet.de [212.18.221.110]) by sourceware.org (Postfix) with ESMTP id C0D193861826 for ; Wed, 25 Nov 2020 17:07:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C0D193861826 Received: by oc3353602072.ibm.com (Postfix, from userid 1000) id 62AF41760285; Wed, 25 Nov 2020 18:07:06 +0100 (CET) From: Marius Hillenbrand To: Andreas Krebbel Cc: gcc-patches@gcc.gnu.org, Marius Hillenbrand Subject: [PATCH 2/2] gcc/testsuite/s390: Add test cases for float_t Date: Wed, 25 Nov 2020 18:06:25 +0100 Message-Id: <20201125170622.5032-3-mhillen@linux.ibm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201125170622.5032-1-mhillen@linux.ibm.com> References: <20201125170622.5032-1-mhillen@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, PDS_RDNS_DYNAMIC_FP, RDNS_DYNAMIC, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2020 17:07:08 -0000 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-11-25 Marius Hillenbrand * gcc.target/s390/float_t-1.c: New test. * gcc.target/s390/float_t-2.c: New test. --- gcc/testsuite/gcc.target/s390/float_t-1.c | 15 +++++++++++++++ gcc/testsuite/gcc.target/s390/float_t-2.c | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/float_t-1.c create mode 100644 gcc/testsuite/gcc.target/s390/float_t-2.c 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 00000000000..3455694250f --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/float_t-1.c @@ -0,0 +1,15 @@ +/* { dg-do run } */ +/* { dg-options "-std=c99" } */ +#include +#include + +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 00000000000..ebeda28b6d2 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/float_t-2.c @@ -0,0 +1,13 @@ +/* { dg-do run } */ +/* { dg-options "-std=gnu99" } */ +#include +#include + +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; +} -- 2.26.2