All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 3/4] builtin: add testcases for expansion of special FP constants
Date: Sat, 17 Feb 2018 15:56:33 +0100	[thread overview]
Message-ID: <20180217145634.53616-4-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20180217145634.53616-1-luc.vanoostenryck@gmail.com>

More specifically: for __builtin_nan(), _huge_val() & _inf()

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/expand/builtin_huge_val.c | 39 ++++++++++++++++++++++++++++++++++++
 validation/expand/builtin_nan.c      | 23 +++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 validation/expand/builtin_huge_val.c
 create mode 100644 validation/expand/builtin_nan.c

diff --git a/validation/expand/builtin_huge_val.c b/validation/expand/builtin_huge_val.c
new file mode 100644
index 000000000..09ef2a6f3
--- /dev/null
+++ b/validation/expand/builtin_huge_val.c
@@ -0,0 +1,39 @@
+static float huge_valf(void)
+{
+	return __builtin_huge_valf();
+}
+
+static double huge_val(void)
+{
+	return __builtin_huge_val();
+}
+
+static long double huge_vall(void)
+{
+	return __builtin_huge_vall();
+}
+
+
+static float inff(void)
+{
+	return __builtin_inff();
+}
+
+static double inf(void)
+{
+	return __builtin_inf();
+}
+
+static long double infl(void)
+{
+	return __builtin_infl();
+}
+
+/*
+ * check-name: builtin_huge_val expand
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: call
+ */
diff --git a/validation/expand/builtin_nan.c b/validation/expand/builtin_nan.c
new file mode 100644
index 000000000..20e3ae925
--- /dev/null
+++ b/validation/expand/builtin_nan.c
@@ -0,0 +1,23 @@
+static float nanf(void)
+{
+	return __builtin_nanf("0");
+}
+
+static double nan(void)
+{
+	return __builtin_nan("0");
+}
+
+static long double nanl(void)
+{
+	return __builtin_nanl("0");
+}
+
+/*
+ * check-name: builtin_nan expand
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: call
+ */
-- 
2.16.0


  parent reply	other threads:[~2018-02-17 14:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-17 14:56 [PATCH 0/4] expansion of builtin FP predicates (isinf(), ...) Luc Van Oostenryck
2018-02-17 14:56 ` [PATCH 1/4] builtin: extract eval_args() from arguments_choose() Luc Van Oostenryck
2018-02-17 14:56 ` [PATCH 2/4] builtin: add typechecking of isnan(), isinf(), Luc Van Oostenryck
2018-02-17 14:56 ` Luc Van Oostenryck [this message]
2018-02-17 14:56 ` [PATCH 4/4] builtin: add testcases for expansion of FP classification Luc Van Oostenryck

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=20180217145634.53616-4-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.