[PATCH 1/5] testcase for SET{EQ,NE}([SZ]EXT(x, N),{0,1})'s simplification

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

 



Add some basic testcase for these relatively common
simplification opportunities.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/optim/bool-sext-test.c | 13 +++++++++++++
 validation/optim/bool-zext-test.c | 13 +++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 validation/optim/bool-sext-test.c
 create mode 100644 validation/optim/bool-zext-test.c

diff --git a/validation/optim/bool-sext-test.c b/validation/optim/bool-sext-test.c
new file mode 100644
index 000000000..0ca3dea9a
--- /dev/null
+++ b/validation/optim/bool-sext-test.c
@@ -0,0 +1,13 @@
+_Bool eqs0(  signed char a) { return a == 0; }
+_Bool eqs1(  signed char a) { return a == 1; }
+_Bool nes0(  signed char a) { return a != 0; }
+_Bool nes1(  signed char a) { return a != 1; }
+
+/*
+ * check-name: bool-sext-test
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: sext\\.
+ */
diff --git a/validation/optim/bool-zext-test.c b/validation/optim/bool-zext-test.c
new file mode 100644
index 000000000..f837ace20
--- /dev/null
+++ b/validation/optim/bool-zext-test.c
@@ -0,0 +1,13 @@
+_Bool equ0(unsigned char a) { return a == 0; }
+_Bool equ1(unsigned char a) { return a == 1; }
+_Bool neu0(unsigned char a) { return a != 0; }
+_Bool neu1(unsigned char a) { return a != 1; }
+
+/*
+ * check-name: bool-zext-test
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: zext\\.
+ */
-- 
2.18.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