diff options
author | Iain Sandoe <iains@gcc.gnu.org> | 2019-07-26 18:58:02 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2019-07-26 18:58:02 +0000 |
commit | 4f67cda8715f31107147e27346e10aacb8871697 (patch) | |
tree | cff10c5a766a16064b05f67b85b77d95539547f9 /gcc | |
parent | a5378f9b60d37d9839aea8f9ef50ad9c5a0f738c (diff) | |
download | gcc-4f67cda8715f31107147e27346e10aacb8871697.zip gcc-4f67cda8715f31107147e27346e10aacb8871697.tar.gz gcc-4f67cda8715f31107147e27346e10aacb8871697.tar.bz2 |
[Darwin, testsuite] Handle Darwin's size command.
Darwin's "size" command has a different header line, reflecting the Mach-O
section naming conventions. This causes tests using the command to fail
because scanasm.exp expects and checks specific layout of the header line.
gcc/testsuite/
2019-07-26 Iain Sandoe <iain@sandoe.co.uk>
* lib/scanasm.exp (object-size): Handle Darwin's size command.
From-SVN: r273839
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/lib/scanasm.exp | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f899b5b..5bdbabb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,8 @@ -2018-07-24 Tamar Christina <tamar.christina@arm.com> +2019-07-26 Iain Sandoe <iain@sandoe.co.uk> + + * lib/scanasm.exp (object-size): Handle Darwin's size command. + +2018-07-26 Tamar Christina <tamar.christina@arm.com> * gcc.dg/type-convert-var.c: New test. diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp index 35ccbc8..231a4d6 100644 --- a/gcc/testsuite/lib/scanasm.exp +++ b/gcc/testsuite/lib/scanasm.exp @@ -460,15 +460,23 @@ proc object-size { args } { set text [lindex $output 1] set lines [split $text "\n"] + set l0match {^\s*text\s+data\s+bss\s+dec\s+hex\s+filename\s*$} + set l1match {^\s*\d+\s+\d+\s+\d+\s+\d+\s+[\da-fA-F]+\s+} + + if { [istarget *-*-darwin*] } { + set l0match {^\s*__TEXT\s+__DATA\s+__OBJC\s+others\s+dec\s+hex\s*$} + set l1match {^\s*\d+\s+\d+\s+\d+\s+\d+\s+\d+\s+[\da-fA-F]+\s+} + } + set line0 [lindex $lines 0] - if ![regexp {^\s*text\s+data\s+bss\s+dec\s+hex\s+filename\s*$} $line0] { + if ![regexp $l0match $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] { + if ![regexp $l1match $line1] { verbose -log "$testcase object-size: $size did not produce expected second line: $line1" unresolved "$testcase object-size $what $cmp $with" return |