public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>, Aldy Hernandez <aldyh@redhat.com>
Subject: [COMMITTED] Add stubs for floating point range-op tests.
Date: Wed, 12 Oct 2022 08:50:50 +0200	[thread overview]
Message-ID: <20221012065050.412900-5-aldyh@redhat.com> (raw)
In-Reply-To: <20221012065050.412900-1-aldyh@redhat.com>

gcc/ChangeLog:

	* range-op-float.cc (frange_float): New.
	(range_op_float_tests): New.
	* range-op.cc (range_op_tests): Call range_op_float_tests.
---
 gcc/range-op-float.cc | 26 ++++++++++++++++++++++++++
 gcc/range-op.cc       |  3 +++
 2 files changed, 29 insertions(+)

diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc
index 71cdd112b86..22b7418c197 100644
--- a/gcc/range-op-float.cc
+++ b/gcc/range-op-float.cc
@@ -1612,3 +1612,29 @@ floating_op_table::set (enum tree_code code, range_operator_float &op)
   gcc_checking_assert (m_range_tree[code] == NULL);
   m_range_tree[code] = &op;
 }
+
+#if CHECKING_P
+#include "selftest.h"
+
+namespace selftest
+{
+
+// Build an frange from string endpoints.
+
+inline frange
+frange_float (const char *lb, const char *ub, tree type = float_type_node)
+{
+  REAL_VALUE_TYPE min, max;
+  gcc_assert (real_from_string (&min, lb) == 0);
+  gcc_assert (real_from_string (&max, ub) == 0);
+  return frange (type, min, max);
+}
+
+void
+range_op_float_tests ()
+{
+}
+
+} // namespace selftest
+
+#endif // CHECKING_P
diff --git a/gcc/range-op.cc b/gcc/range-op.cc
index 4d5a033dfa5..16fa1f4f46d 100644
--- a/gcc/range-op.cc
+++ b/gcc/range-op.cc
@@ -4829,6 +4829,9 @@ range_op_tests ()
   range_op_bitwise_and_tests ();
   range_op_cast_tests ();
   range_relational_tests ();
+
+  extern void range_op_float_tests ();
+  range_op_float_tests ();
 }
 
 } // namespace selftest
-- 
2.37.3


      parent reply	other threads:[~2022-10-12  6:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  6:50 [COMMITTED] Add default relation_kind to floating point range-op entries Aldy Hernandez
2022-10-12  6:50 ` [COMMITTED] Add an frange(type) constructor analogous to the irange version Aldy Hernandez
2022-10-12  6:50 ` [COMMITTED] Disable tree to bool conversion in frange::update_nan Aldy Hernandez
2022-10-12  6:50 ` [COMMITTED] Add method to query the sign of a NAN Aldy Hernandez
2022-10-12  6:50 ` Aldy Hernandez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221012065050.412900-5-aldyh@redhat.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).