aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/lib
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2012-11-27 17:26:11 +0000
committerRoland McGrath <roland@gnu.org>2012-11-27 17:26:11 +0000
commit659518555272d23be5bc8a4950ad565d95b7b6a0 (patch)
tree0150a8c08be2616c8b14de01a52edbba368decce /binutils/testsuite/lib
parent2a64e9e88d146e56fceb399d9a245e62078025c7 (diff)
downloadgdb-659518555272d23be5bc8a4950ad565d95b7b6a0.zip
gdb-659518555272d23be5bc8a4950ad565d95b7b6a0.tar.gz
gdb-659518555272d23be5bc8a4950ad565d95b7b6a0.tar.bz2
binutils/testsuite/
* lib/binutils-common.exp (is_zlib_supported): New function. * lib/utils-lib.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported. * binutils-all/compress.exp: Bail out if zlib is not available. * binutils-all/objdump.exp (objdump compressed debug): Mark unsupported if zlib is not available. * binutils-all/readelf.exp (readelf_compressed_wa_test): Likewise. gas/testsuite/ * lib/gas-defs.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported. ld/testsuite/ * ld-elf/compress.exp: Bail out if zlib is not supported. * lib/ld-lib.exp (run_dump_test): If as options include --compress-debug-sections and zlib is not available, report the test as unsupported.
Diffstat (limited to 'binutils/testsuite/lib')
-rw-r--r--binutils/testsuite/lib/binutils-common.exp25
-rw-r--r--binutils/testsuite/lib/utils-lib.exp22
2 files changed, 39 insertions, 8 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 0054184..68efb90 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -152,6 +152,31 @@ proc is_elf64 { binary_file } {
return 0
}
+# True if the build supports zlib compression.
+proc is_zlib_supported {} {
+
+ # This replicates the AS selection logic of dejagnu's target_assemble.
+ global AS_FOR_TARGET
+ if [info exists AS_FOR_TARGET] {
+ set AS $AS_FOR_TARGET
+ } else {
+ if {![board_info target exists assembler]} {
+ set AS [find_gas]
+ } else {
+ set AS [board_info target assembler]
+ }
+ }
+
+ set as_output [remote_exec host "$AS --help"]
+
+ set have_zlib 0
+ if {[string first "--compress-debug-sections" $as_output] >= 0} {
+ set have_zlib 1
+ }
+
+ return $have_zlib
+}
+
# Compare two files line-by-line. FILE_1 is the actual output and FILE_2
# is the expected output. Ignore blank lines in either file.
#
diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp
index b96043b..3fe6c14 100644
--- a/binutils/testsuite/lib/utils-lib.exp
+++ b/binutils/testsuite/lib/utils-lib.exp
@@ -1,16 +1,16 @@
# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004, 2006, 2007,
-# 2009, 2010 Free Software Foundation, Inc.
+# 2009, 2010, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
@@ -405,7 +405,7 @@ proc run_dump_test { name {extra_options {}} } {
if { $opts(not-skip) != "" } then {
set skip 1
foreach glob $opts(not-skip) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
@@ -420,25 +420,31 @@ proc run_dump_test { name {extra_options {}} } {
}
set skip 1
foreach glob $opts(target) {
- if {[istarget $glob]} {
+ if {[istarget $glob]} {
set skip 0
break
}
}
- if {$skip} {
+ if {$skip} {
unsupported $testname
- return
+ return
}
}
if { $opts(not-target) != "" } then {
foreach glob $opts(not-target) {
if {[istarget $glob]} {
unsupported $testname
- return
+ return
}
}
}
+ if { [string match "*--compress-debug-sections*" $opts(as)] \
+ && ![is_zlib_supported] } {
+ unsupported $testname
+ return
+ }
+
if { $opts(source) == "" } {
set srcfile ${file}.s
} else {