From: "H.J. Lu" <hjl.tools@gmail.com>
To: binutils@sourceware.org
Subject: [PATCH] Add a testcase for PR binutils/27202
Date: Tue, 28 Sep 2021 22:47:21 -0700 [thread overview]
Message-ID: <20210929054721.1763491-1-hjl.tools@gmail.com> (raw)
If there are no objections, I will check in this tomorrow.
PR binutils/27202
* testsuite/gas/elf/dwarf-5-loc0.d: New file.
* testsuite/gas/elf/dwarf-5-loc0.s: Likewise.
* testsuite/gas/elf/elf.exp: Run dwarf-5-loc0.
---
gas/testsuite/gas/elf/dwarf-5-loc0.d | 16 ++++++++++++++++
gas/testsuite/gas/elf/dwarf-5-loc0.s | 11 +++++++++++
gas/testsuite/gas/elf/elf.exp | 1 +
3 files changed, 28 insertions(+)
create mode 100644 gas/testsuite/gas/elf/dwarf-5-loc0.d
create mode 100644 gas/testsuite/gas/elf/dwarf-5-loc0.s
diff --git a/gas/testsuite/gas/elf/dwarf-5-loc0.d b/gas/testsuite/gas/elf/dwarf-5-loc0.d
new file mode 100644
index 00000000000..eb752c9caed
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf-5-loc0.d
@@ -0,0 +1,16 @@
+#as: -gdwarf-5
+#readelf: -wL
+#name: DWARF5 .loc 0
+# The am33 cr16 crx ft32 mn10 msp430 nds32 and rl78 targets do not evaluate the subtraction of symbols at assembly time.
+# The riscv targets do not support the subtraction of symbols.
+#xfail: am3*-* cr16-* crx-* ft32*-* mn10*-* msp430-* nds32*-* riscv*-* rl78-*
+
+Contents of the \.debug_line section:
+
+CU: \./foo\.c:
+File name +Line number +Starting address +View +Stmt
+
+\./foo.c:\[\+\+\]
+foo\.c +1 +0x8 +x
+foo\.c +2 +0x10 +x
+foo\.c +- +0x10
diff --git a/gas/testsuite/gas/elf/dwarf-5-loc0.s b/gas/testsuite/gas/elf/dwarf-5-loc0.s
new file mode 100644
index 00000000000..093d5bc39f3
--- /dev/null
+++ b/gas/testsuite/gas/elf/dwarf-5-loc0.s
@@ -0,0 +1,11 @@
+ .file "foo.c"
+ .text
+ .balign 16
+ .globl _start
+_start:
+ .file 0 "foo.c"
+ .quad 0
+ .loc 0 1 view 0
+ .balign 16
+ .loc 0 2 view 0
+ .size _start, .-_start
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index ab862640974..df6b2851c78 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -300,6 +300,7 @@ if { [is_elf_format] } then {
run_dump_test "dwarf-5-file0" $dump_opts
run_dump_test "dwarf-5-file0-2" $dump_opts
run_dump_test "dwarf-5-dir0" $dump_opts
+ run_dump_test "dwarf-5-loc0" $dump_opts
run_dump_test "dwarf-4-cu" $dump_opts
run_dump_test "dwarf-5-cu" $dump_opts
run_dump_test "dwarf-5-nop-for-line-table" $dump_opts
--
2.31.1
reply other threads:[~2021-09-29 5:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210929054721.1763491-1-hjl.tools@gmail.com \
--to=hjl.tools@gmail.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).