aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-21 10:24:33 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-21 14:07:26 +0100
commitd7361313e11c698f5aef4ab5c9bc6ea90bdb58c9 (patch)
tree150eef243c05fcc209ebb452b668c4632b962501
parent8af0e8a2ebcf53dde914c9e84f09bc0c46d73d81 (diff)
downloadsparse-d7361313e11c698f5aef4ab5c9bc6ea90bdb58c9.tar.gz
asm-mem: add testcase for missing reload after asm memops
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>
-rw-r--r--validation/mem2reg/asm-reload0.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/validation/mem2reg/asm-reload0.c b/validation/mem2reg/asm-reload0.c
new file mode 100644
index 00000000..c9e297dd
--- /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\\.
+ */