[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[committed] Add pr24468.sh test-case
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