From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED][2.42] gas: scfi: add missing ginsn-cofi-1 testcase files
Date: Tue, 30 Jan 2024 00:54:31 -0800 [thread overview]
Message-ID: <20240130085431.737432-1-indu.bhagat@oracle.com> (raw)
Committed as obvious.
----------
Previous commit a58dc5427f0 intended to bring the following two commits
from master branch:
91cdbed4d7b gas: scfi: untraceable control flow should be a hard error
16cbeae1b27 x86: testsuite: scfi: adjust COFI testcase
But missed adding the testcase files. Fix the failure by adding the
missing files.
gas/testsuite/
* gas/scfi/x86_64/ginsn-cofi-1.l: New test.
* gas/scfi/x86_64/ginsn-cofi-1.s: Likewise.
---
gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l | 38 ++++++++++++++++++++
gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s | 20 +++++++++++
2 files changed, 58 insertions(+)
create mode 100644 gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l
create mode 100644 gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s
diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l
new file mode 100644
index 00000000000..ab6b50d47e8
--- /dev/null
+++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.l
@@ -0,0 +1,38 @@
+.*: Assembler messages:
+.*:20: Error: untraceable control flow for func 'foo'
+GAS LISTING .*
+
+
+ 1 # Testcase with a variety of "change of flow instructions"
+ 2 #
+ 3 # This test does not have much going on wrt synthesis of CFI;
+ 4 # it just aims to ensure x8_64 -> ginsn decoding behaves
+ 5 # gracefully for these "change of flow instructions"
+ 6 .text
+ 7 .globl foo
+ 8 .type foo, @function
+ 8 ginsn: SYM FUNC_BEGIN
+ 9 foo:
+ 9 ginsn: SYM foo
+ 10 \?\?\?\? 4801D0 addq %rdx, %rax
+ 10 ginsn: ADD %r1, %r0, %r0
+ 11 \?\?\?\? E200 loop foo
+ 11 ginsn: JCC
+ 12 \?\?\?\? 3EFFE0 notrack jmp \*%rax
+ 12 ginsn: JMP %r0,
+ 13 \?\?\?\? 41FFD0 call \*%r8
+ 13 ginsn: CALL
+ 14 \?\?\?\? 67E305 jecxz .L179
+ 14 ginsn: JCC
+ 15 \?\?\?\? FF6730 jmp \*48\(%rdi\)
+ 15 ginsn: JMP %r5,
+ 16 \?\?\?\? 7000 jo .L179
+ 16 ginsn: JCC
+ 17 .L179:
+ 17 ginsn: SYM .L179
+ 18 \?\?\?\? C3 ret
+ 18 ginsn: RET
+ 19 .LFE0:
+ 19 ginsn: SYM .LFE0
+ 20 .size foo, .-foo
+ 20 ginsn: SYM FUNC_END
diff --git a/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s
new file mode 100644
index 00000000000..0a63910e046
--- /dev/null
+++ b/gas/testsuite/gas/scfi/x86_64/ginsn-cofi-1.s
@@ -0,0 +1,20 @@
+# Testcase with a variety of "change of flow instructions"
+#
+# This test does not have much going on wrt synthesis of CFI;
+# it just aims to ensure x8_64 -> ginsn decoding behaves
+# gracefully for these "change of flow instructions"
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ addq %rdx, %rax
+ loop foo
+ notrack jmp *%rax
+ call *%r8
+ jecxz .L179
+ jmp *48(%rdi)
+ jo .L179
+.L179:
+ ret
+.LFE0:
+ .size foo, .-foo
--
2.43.0
next reply other threads:[~2024-01-30 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 8:54 Indu Bhagat [this message]
2024-01-30 12:36 ` Nick Clifton
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=20240130085431.737432-1-indu.bhagat@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=binutils@sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).