aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-08-03 22:28:41 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-08-03 22:28:41 +0000
commit8b5b2228f8261121aeb52ca57af40318a65f1e9d (patch)
tree6f5525968bfe54e16486752493bcb0b4b057cf9b /ld/testsuite
parent3db8daf394c77169312d5cec31f23e1eaff5c272 (diff)
downloadgdb-8b5b2228f8261121aeb52ca57af40318a65f1e9d.zip
gdb-8b5b2228f8261121aeb52ca57af40318a65f1e9d.tar.gz
gdb-8b5b2228f8261121aeb52ca57af40318a65f1e9d.tar.bz2
* lib/ld-lib.exp (at_least_gcc_version): Accept more version
number formats; avoid throwing exceptions in any case.
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog5
-rw-r--r--ld/testsuite/lib/ld-lib.exp11
2 files changed, 13 insertions, 3 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 3811b14..5a63a94 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
+ * lib/ld-lib.exp (at_least_gcc_version): Accept more version
+ number formats; avoid throwing exceptions in any case.
+
+2012-08-03 Maciej W. Rozycki <macro@codesourcery.com>
+
* ld-mips-elf/mode-change-error-1.d: Update the error message.
2012-08-02 Maciej W. Rozycki <macro@codesourcery.com>
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index a481ce7..de0f7ad 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -41,14 +41,19 @@ proc at_least_gcc_version { major minor } {
set state [remote_exec host $CC --version]
set tmp "[lindex $state 1]\n"
# Look for (eg) 4.6.1 in the version output.
- regexp " .* (\[1-9\])\\.(\[0-9\])\\.\[0-9\]* .*" "$tmp" fred maj min
+ set ver_re "\[^\\.0-9\]+(\[1-9\]\[0-9\]*)\\.(\[0-9\]+)(?:\\.\[0-9\]+)?"
+ regexp $ver_re $tmp fred maj min
verbose "gcc version: $tmp"
+ if { ![info exists maj] || ![info exists min] } then {
+ perror "can't decipher gcc version number, fix the framework!"
+ return 0
+ }
verbose "major gcc version is $maj, want at least $major"
if { $maj == $major } then {
verbose "minor gcc version is $min, want at least $minor"
- return [expr $min >= $minor ]
+ return [expr $min >= $minor]
} else {
- return [expr $maj > $major ]
+ return [expr $maj > $major]
}
}