]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - binutils/testsuite/binutils-all/objdump.exp
bfd/
[thirdparty/binutils-gdb.git] / binutils / testsuite / binutils-all / objdump.exp
index 335b8bdf632872cccad6dfa7f869c15d91066e5e..b9416a4ddad92cf6b4f7a345772ac9fa0c57f684 100644 (file)
@@ -158,6 +158,49 @@ if [regexp $want $got] then {
     fail "objdump -s"
 }
 
+# Test objdump -s on a file that contains a compressed .debug section
+
+if {![binutils_assemble $srcdir/$subdir/dw2-compressed.S tmpdir/dw2-compressed.o]} then {
+    return
+}
+if [is_remote host] {
+    set compressed_testfile [remote_download host tmpdir/dw2-compressed.o]
+} else {
+    set compressed_testfile tmpdir/dw2-compressed.o
+}
+
+set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "objdump.out"]
+
+if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
+    fail "objdump -s -j .zdebug_abbrev (reason: unexpected output)"
+    send_log $got
+    send_log "\n"
+}
+
+if { [regexp_diff objdump.out $srcdir/$subdir/objdump.s] } then {
+    fail "objdump -s -j .zdebug_abbrev"
+} else {
+    pass "objdump -s -j .zdebug_abbrev"
+}
+
+# Test objdump -W on a file that contains some compressed .debug sections
+
+set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -W $compressed_testfile" "" "/dev/null" "objdump.out"]
+
+if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
+    fail "objdump -W (reason: unexpected output)"
+    send_log $got
+    send_log "\n"
+}
+
+if { [regexp_diff objdump.out $srcdir/$subdir/objdump.W] } then {
+    fail "objdump -W"
+} else {
+    pass "objdump -W"
+}
+
+
+
 # Options which are not tested: -a -d -D -R -T -x -l --stabs
 # I don't see any generic way to test any of these other than -a.
 # Tests could be written for specific targets, and that should be done