diff mbox series

[1/3] asm: add testcase for problem with output addresses

Message ID 20210221222834.7974-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series output *memory* operands need their address as *input* | expand

Commit Message

Luc Van Oostenryck Feb. 21, 2021, 10:28 p.m. UTC
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>
---
 validation/linear/asm-out0.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 validation/linear/asm-out0.c
diff mbox series

Patch

diff --git a/validation/linear/asm-out0.c b/validation/linear/asm-out0.c
new file mode 100644
index 000000000000..64d154ed5ad7
--- /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
+ */