From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 1/3] asm: add testcase for problem with output addresses
Date: Sun, 21 Feb 2021 23:28:32 +0100 [thread overview]
Message-ID: <20210221222834.7974-2-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20210221222834.7974-1-luc.vanoostenryck@gmail.com>
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 --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
+ */
--
2.30.0
next prev parent reply other threads:[~2021-02-21 22:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-21 22:28 [PATCH 0/3] output *memory* operands need their address as *input* Luc Van Oostenryck
2021-02-21 22:28 ` Luc Van Oostenryck [this message]
2021-02-21 22:28 ` [PATCH 2/3] asm: factor out add_asm_rule() from add_asm_{in,out}put() Luc Van Oostenryck
2021-02-21 22:28 ` [PATCH 3/3] asm: output *memory* operands need their address as *input* Luc Van Oostenryck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210221222834.7974-2-luc.vanoostenryck@gmail.com \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).