[PATCH 1/5] add testcases for stores simplifications

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

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/memops/kill-dead-store-parent0.c | 15 ++++++++++++
 validation/memops/kill-dead-store-parent2.c | 26 +++++++++++++++++++++
 validation/memops/kill-redundant-store0.c   | 14 +++++++++++
 3 files changed, 55 insertions(+)
 create mode 100644 validation/memops/kill-dead-store-parent0.c
 create mode 100644 validation/memops/kill-dead-store-parent2.c
 create mode 100644 validation/memops/kill-redundant-store0.c

diff --git a/validation/memops/kill-dead-store-parent0.c b/validation/memops/kill-dead-store-parent0.c
new file mode 100644
index 000000000000..1413134b8c23
--- /dev/null
+++ b/validation/memops/kill-dead-store-parent0.c
@@ -0,0 +1,15 @@
+void foo(int *ptr, int p)
+{
+	if (p)
+		*ptr = 1;
+	*ptr = 0;
+}
+
+/*
+ * check-name: kill-dead-store-parent0
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-pattern(1): store
+ */
diff --git a/validation/memops/kill-dead-store-parent2.c b/validation/memops/kill-dead-store-parent2.c
new file mode 100644
index 000000000000..b563fd31b669
--- /dev/null
+++ b/validation/memops/kill-dead-store-parent2.c
@@ -0,0 +1,26 @@
+int ladder02(int *ptr, int p, int x)
+{
+	*ptr = x++;
+	if (p)
+		goto l11;
+	else
+		goto l12;
+l11:
+	*ptr = x++;
+	goto l20;
+l12:
+	*ptr = x++;
+	goto l20;
+l20:
+	*ptr = x++;
+	return *ptr;
+}
+
+/*
+ * check-name: kill-dead-store-parent2
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-pattern(1): store
+ */
diff --git a/validation/memops/kill-redundant-store0.c b/validation/memops/kill-redundant-store0.c
new file mode 100644
index 000000000000..e911166dd953
--- /dev/null
+++ b/validation/memops/kill-redundant-store0.c
@@ -0,0 +1,14 @@
+void foo(int *ptr)
+{
+	int i = *ptr;
+	*ptr = i;
+}
+
+/*
+ * check-name: kill-redundant-store0
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: store
+ */
-- 
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