[PATCH 3/4] builtin: add testcases for expansion of special FP constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux