[SPARSE 2/4] add testcases for AND(x > 0, x <= C) --> x u<= C

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

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/optim/range-check1.c | 17 +++++++++++++++++
 validation/optim/range-check2.c | 15 +++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 validation/optim/range-check1.c
 create mode 100644 validation/optim/range-check2.c

diff --git a/validation/optim/range-check1.c b/validation/optim/range-check1.c
new file mode 100644
index 000000000000..82b939917da4
--- /dev/null
+++ b/validation/optim/range-check1.c
@@ -0,0 +1,17 @@
+#define N	1024
+
+_Bool check_ok(long i)
+{
+	return i >= 0 && i < N;
+}
+
+/*
+ * check-name: range-check1
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-contains: setbe\\..*0x3ff
+ * check-output-excludes: set[lga][te]\\.
+ * check-output-excludes: set[ab]\\.
+ */
diff --git a/validation/optim/range-check2.c b/validation/optim/range-check2.c
new file mode 100644
index 000000000000..f565b84ea9db
--- /dev/null
+++ b/validation/optim/range-check2.c
@@ -0,0 +1,15 @@
+#define N	1024
+
+_Bool check_ok(int i)
+{
+	return (i >= 0 && i < N) == (((unsigned int)i) < N);
+}
+
+/*
+ * check-name: range-check2
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */
-- 
2.31.1




[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