public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Add pr24468.sh test-case
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190423122016.GA32381@delia> (raw)

Hi,

Add a test-case for PR24468, using a pre-built executable hello-leap-15.0,
only 4kb large.

Committed to trunk.

Thanks,
- Tom

Add pr24468.sh test-case

2019-04-23  Tom de Vries  <tdevries@suse.de>

	PR dwz/24468
	* testsuite/dwz.tests/execs.xz/hello-leap-15.0.xz: New zipped
	executable.
	* testsuite/dwz.tests/pr24468.sh: New test.
	* testsuite/dwz.tests/dwz-tests.exp: Require x86_64 for pr24468.sh.

---
 testsuite/dwz.tests/dwz-tests.exp               |   6 ++++++
 testsuite/dwz.tests/execs.xz/hello-leap-15.0.xz | Bin 0 -> 3996 bytes
 testsuite/dwz.tests/pr24468.sh                  |  18 ++++++++++++++++++
 3 files changed, 24 insertions(+)

diff --git a/testsuite/dwz.tests/dwz-tests.exp b/testsuite/dwz.tests/dwz-tests.exp
index 1e6bd0f..04f00fc 100644
--- a/testsuite/dwz.tests/dwz-tests.exp
+++ b/testsuite/dwz.tests/dwz-tests.exp
@@ -36,6 +36,12 @@ foreach test $tests {
 	    continue
 	}
     }
+    if { ![istarget x86_64-*-*] } {
+	if { $basename == "pr24468.sh" } {
+	    unsupported "$test"
+	    continue
+	}
+    }
 
     set unsupported 0
     foreach required_exec $required_execs {
diff --git a/testsuite/dwz.tests/execs.xz/hello-leap-15.0.xz b/testsuite/dwz.tests/execs.xz/hello-leap-15.0.xz
new file mode 100755
index 0000000..598c88e
Binary files /dev/null and b/testsuite/dwz.tests/execs.xz/hello-leap-15.0.xz differ
diff --git a/testsuite/dwz.tests/pr24468.sh b/testsuite/dwz.tests/pr24468.sh
new file mode 100644
index 0000000..b03fdf9
--- /dev/null
+++ b/testsuite/dwz.tests/pr24468.sh
@@ -0,0 +1,18 @@
+exec=$execs/testsuite/dwz.tests/execs/hello-leap-15.0
+
+cp $exec 1
+cp 1 2
+
+dwz -m 3 1 2
+
+readelf -w 1 > READELF 2>/dev/null
+
+offsets=$(grep '(DW_TAG_partial_unit' READELF \
+	      | awk '{print $1}' \
+	      | sed 's/.*<//;s/>.*//')
+for off in $offsets; do
+    imports=$(grep -c "DW_AT_import.*0x$off" READELF || true)
+    [ $imports -gt 0 ]
+done
+
+rm -f 1 2 3 READELF

                 reply	other threads:[~2019-04-23 12:20 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=20190423122016.GA32381@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /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).