aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-20 06:37:53 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-02-21 12:37:08 +0100
commita7318222f5fab499eaf482945c353b3cce517cd4 (patch)
treecec5088a8eacc48224fc1b826141fbc440e185d9
parent60c1f2706e30eacc29296e6cb5d9327c85a01340 (diff)
downloadsparse-a7318222f5fab499eaf482945c353b3cce517cd4.tar.gz
asm: add testcase for problem with output addresses
The addresses needed by memory output operands are linearized (and placed) after the ASM instruction needing them. So, add a test case for this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--validation/linear/asm-out0.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/validation/linear/asm-out0.c b/validation/linear/asm-out0.c
new file mode 100644
index 00000000..64d154ed
--- /dev/null
+++ b/validation/linear/asm-out0.c
@@ -0,0 +1,26 @@
+static void asm_out0(void)
+{
+ int mem;
+ asm volatile ("[%1] <= 0" : "=m" (mem));
+}
+
+/*
+ * check-name: asm-out0
+ * check-command: test-linearize -fdump-ir $file
+ * check-known-to-fail
+ *
+ * check-output-start
+asm_out0:
+.L0:
+ <entry-point>
+ symaddr.64 %r1 <- mem
+ asm "[%1] <= 0"
+ out: "=m" (%r1)
+ br .L1
+
+.L1:
+ ret
+
+
+ * check-output-end
+ */