diff mbox series

[2/5] asm-mem: add testcase for missing reload after asm memops

Message ID 20210221223452.8075-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series teach memory simplification about ASM instructions | expand

Commit Message

Luc Van Oostenryck Feb. 21, 2021, 10:34 p.m. UTC
Memory simplification is done with the help of the function
dominates() which determine when memory instructions interfere.

This function handles OP_CALLs, OP_LOADs and OP_STOREs but
memory can also be changed via OP_ASMs.

Add a testcase showing this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/mem2reg/asm-reload0.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 validation/mem2reg/asm-reload0.c
diff mbox series

Patch

diff --git a/validation/mem2reg/asm-reload0.c b/validation/mem2reg/asm-reload0.c
new file mode 100644
index 000000000000..c9e297dde428
--- /dev/null
+++ b/validation/mem2reg/asm-reload0.c
@@ -0,0 +1,15 @@ 
+static int asm_reload(void)
+{
+	int mem = 0;
+	asm volatile ("[%1] <= 1" : "=m" (mem));
+	return mem;
+}
+
+/*
+ * check-name: asm-reload0
+ * check-command: test-linearize $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-contains: load\\.
+ */