[PATCH 2/4] add test cases for canonicalization of mul chains

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

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/optim/canonical-mul.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 validation/optim/canonical-mul.c

diff --git a/validation/optim/canonical-mul.c b/validation/optim/canonical-mul.c
new file mode 100644
index 000000000..90d59f2e2
--- /dev/null
+++ b/validation/optim/canonical-mul.c
@@ -0,0 +1,24 @@
+#define uint unsigned int
+
+uint xtc_umul_ytc(uint x, uint y) { return (x * 3) * (y * 2); }
+
+/*
+ * check-name: canonical-muldiv
+ * check-description:
+ *	1) verify that constants in mul chains are
+ *	   pushed at the right of the whole chain.
+ *	   For example '(a * 3) * b' must be canonicalized into '(a * b) * 1'
+ *	   This is needed in general for constant simplification;
+ *	   for example, for:
+ *		'(a * 3) * (b * 2)'
+ *	   to be simplified into:
+ *		'(a * b) * 6'
+ *
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ * check-output-ignore
+ *
+ * check-output-excludes: \$3
+ * check-output-excludes: \$2
+ * check-output-contains: \$6
+ */
-- 
2.14.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