diff options
author | Janis Johnson <janisjo@codesourcery.com> | 2011-06-20 17:07:24 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2011-06-20 17:07:24 +0000 |
commit | b73b50c9eb95809042f68480b4fcd1c9d7cce476 (patch) | |
tree | c6234591c58b7ffae8b7ee5a9d46d75d5a65ba44 /gcc | |
parent | 83a8cbdab0a2dd9c7dc38a88780907aea27b81a5 (diff) | |
download | gcc-b73b50c9eb95809042f68480b4fcd1c9d7cce476.zip gcc-b73b50c9eb95809042f68480b4fcd1c9d7cce476.tar.gz gcc-b73b50c9eb95809042f68480b4fcd1c9d7cce476.tar.bz2 |
scanasm.exp (object-size): Move argument processing earlier to report errors before verifying that the...
* lib/scanasm.exp (object-size): Move argument processing earlier
to report errors before verifying that the file exists. Report
problems detected at runtime as unresolved instead of error and
report their reasons to the log file.
From-SVN: r175223
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/lib/scanasm.exp | 50 |
2 files changed, 36 insertions, 21 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5590283..23714ca 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2011-06-20 Janis Johnson <janisjo@codesourcery.com> + + * lib/scanasm.exp (object-size): Move argument processing earlier + to report errors before verifying that the file exists. Report + problems detected at runtime as unresolved instead of error and + report their reasons to the log file. + 2011-06-20 Jason Merrill <jason@redhat.com> PR c++/47080 diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 1388bd2..80014d0 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -350,11 +350,35 @@ proc object-size { args } { upvar 2 name testcase set testcase [lindex $testcase 0] + + set what [lindex $args 0] + set where [lsearch { text data bss total } $what] + if { $where == -1 } { + error "object-size: illegal argument: $what" + return + } + set cmp [lindex $args 1] + if { [lsearch { < > <= >= == != } $cmp] == -1 } { + error "object-size: illegal argument: $cmp" + return + } + set with [lindex $args 2] + if ![string is integer $with ] { + error "object-size: illegal argument: $with" + return + } + set output_file "[file rootname [file tail $testcase]].o" + if ![file_on_host exists $output_file] { + verbose -log "$testcase: $output_file does not exist" + unresolved "$testcase object-size $what $cmp $with" + return + } set output [remote_exec host "$size" "$output_file"] set status [lindex $output 0] if { $status != 0 } { - error "object-size: $size failed" + verbose -log "$testcase object-size: $size failed" + unresolved "$testcase object-size $what $cmp $with" return } @@ -363,37 +387,21 @@ proc object-size { args } { set line0 [lindex $lines 0] if ![regexp {^\s*text\s+data\s+bss\s+dec\s+hex\s+filename\s*$} $line0] { - error "object-size: $size did not produce expected first line: $line0" + verbose -log "$testcase object-size: $size did not produce expected first line: $line0" + unresolved "$testcase object-size $what $cmp $with" return } set line1 [lindex $lines 1] if ![regexp {^\s*\d+\s+\d+\s+\d+\s+\d+\s+[\da-fA-F]+\s+} $line1] { - error "object-size: $size did not produce expected second line: $line1" + verbose -log "$testcase object-size: $size did not produce expected second line: $line1" + unresolved "$testcase object-size $what $cmp $with" return } - set what [lindex $args 0] - set where [lsearch { text data bss total } $what] - if { $where == -1 } { - error "object-size: illegal argument: $what" - return - } set actual [lindex $line1 $where] verbose -log "$what size is $actual" - set cmp [lindex $args 1] - if { [lsearch { < > <= >= == != } $cmp] == -1 } { - error "object-size: illegal argument: $cmp" - return - } - - set with [lindex $args 2] - if ![string is integer $with ] { - error "object-size: illegal argument: $with" - return - } - if [expr $actual $cmp $with] { pass "$testcase object-size $what $cmp $with" } else { |