Message ID | b0338e99-8cdc-b6ff-0d36-be1e6beccf65@mentor.com |
---|---|
State | New |
Headers | show |
Series | Add scan-ltrans-tree-dump and scan-wpa-ipa-dump | expand |
>This patch adds scan-ltrans-tree-dump. Please check all error calls to talk about the correct function -- at least scan-ltrans-tree-dump-times is wrong. thanks, > >Bootstrapped and reg-tested on x86_64. > >OK for stage4/stage1 trunk? > >Thanks, >- Tom
On 04/03/2018 07:49 PM, Bernhard Reutner-Fischer wrote: >> This patch adds scan-ltrans-tree-dump. > > Please check all error calls to talk about the correct function -- at least scan-ltrans-tree-dump-times is wrong. > Hi, thanks for noticing that. I'll update the patches to fix that. But I wonder if it's not a better idea to get the function name using "info level", and to move the code that checks the number of arguments into a utility function, as done in the demonstrator patch below. Rainer, Mike, any comments? I can write a patch that uses check_num_args in testsuite/lib/*.exp (though I'm not yet sure where to move it such that it can be used everywhere). Thanks, - Tom diff --git a/gcc/testsuite/lib/scanltranstree.exp b/gcc/testsuite/lib/scanltranstree.exp index c122abb..e4c5c90 100644 --- a/gcc/testsuite/lib/scanltranstree.exp +++ b/gcc/testsuite/lib/scanltranstree.exp @@ -19,6 +19,25 @@ load_lib scandump.exp +proc check_num_args { args } { + set caller_args [lindex $args 0] + set min_args [lindex $args 1] + if { [lindex $args] >= 2 } { + set max_args [lindex $args 2] + } else { + set max_args $min_args + } + set caller_fnname [lindex [info level -1] 0] + if { [llength $caller_args] < $min_args } { + error "$caller_fnname: too few arguments" + return + } + if { [llength $caller_args] > $max_args } { + error "$caller_fnname: too many arguments" + return + } +} + # Utility for scanning compiler result, invoked via dg-final. # Call pass if pattern is present, otherwise fail. # @@ -52,14 +71,7 @@ proc scan-ltrans-tree-dump { args } { # Argument 3 handles expected failures and the like proc scan-ltrans-tree-dump-times { args } { - if { [llength $args] < 3 } { - error "scan-ltrans-tree-dump: too few arguments" - return - } - if { [llength $args] > 4 } { - error "scan-ltrans-tree-dump: too many arguments" - return - } + check_num_args $args 3 4 if { [llength $args] >= 4 } { scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" \
On 4 April 2018 at 10:59, Tom de Vries <Tom_deVries@mentor.com> wrote: > On 04/03/2018 07:49 PM, Bernhard Reutner-Fischer wrote: >>> >>> This patch adds scan-ltrans-tree-dump. >> >> >> Please check all error calls to talk about the correct function -- at >> least scan-ltrans-tree-dump-times is wrong. >> > > Hi, > > thanks for noticing that. I'll update the patches to fix that. > > But I wonder if it's not a better idea to get the function name using "info > level", and to move the code that checks the number of arguments into a > utility function, as done in the demonstrator patch below. Right, good idea, that's even better IMHO. As to where to load it, there are each */testsuite/config/default.exp where you could load_lib something like a gcc/testsuite/lib/utils.exp Oh, and there seem to be a min == max category of errors that want e.g. check_num_args 2 2 and in the min == max case want to emit gcc/testsuite/lib/gcc-dg.exp: error "dg-set-target-env-var: need two arguments" gcc/testsuite/lib/gcc-dg.exp: error "dg-set-compiler-env-var: need two arguments" where i'd use the number of course. Just a thought, though. > > Rainer, Mike, any comments? I can write a patch that uses check_num_args in > testsuite/lib/*.exp (though I'm not yet sure where to move it such that it > can be used everywhere). > > Thanks, > - Tom
On 04/03/2018 07:49 PM, Bernhard Reutner-Fischer wrote: >> This patch adds scan-ltrans-tree-dump. > > Please check all error calls to talk about the correct function -- at least scan-ltrans-tree-dump-times is wrong. > Fixed in this updated patch. OK for trunk? Thanks, - Tom [testsuite] Add scan-ltrans-tree-dump 2018-03-28 Tom de Vries <tom@codesourcery.com> PR testsuite/85106 * gcc.dg/ipa/ipa-icf-38.c: Use scan-ltrans-tree-dump. * lib/scanltranstree.exp: New file. * lib/target-supports.exp (scan-ltrans-tree-dump_required_options) (scan-ltrans-tree-dump-times_required_options) (scan-ltrans-tree-dump-not_required_options) (scan-ltrans-tree-dump-dem_required_options) (scan-ltrans-tree-dump-dem-not_required_options): New proc. * lib/gcc-dg.exp: Include scanltranstree.exp. * testsuite/lib/libatomic.exp: Include scanltranstree.exp. * testsuite/lib/libgomp.exp: Include scanltranstree.exp. * testsuite/lib/libitm.exp: Include scanltranstree.exp. * testsuite/lib/libvtv.exp: Include scanltranstree.exp. * doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization dump files): Add ltrans-tree. --- gcc/doc/sourcebuild.texi | 4 +- gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c | 4 +- gcc/testsuite/lib/gcc-dg.exp | 1 + gcc/testsuite/lib/scanltranstree.exp | 148 ++++++++++++++++++++++++++++++++++ gcc/testsuite/lib/target-supports.exp | 20 +++++ libatomic/testsuite/lib/libatomic.exp | 1 + libgomp/testsuite/lib/libgomp.exp | 1 + libitm/testsuite/lib/libitm.exp | 1 + libvtv/testsuite/lib/libvtv.exp | 1 + 9 files changed, 178 insertions(+), 3 deletions(-) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index ad4f446..16164ae 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2588,8 +2588,8 @@ assembly output. @subsubsection Scan optimization dump files -These commands are available for @var{kind} of @code{tree}, @code{rtl}, -@code{ipa}, and @code{wpa-ipa}. +These commands are available for @var{kind} of @code{tree}, @code{ltrans-tree}, +@code{rtl}, @code{ipa}, and @code{wpa-ipa}. @table @code @item scan-@var{kind}-dump @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}] diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c index 6e7936a..85531ab 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-O2 -fdump-ipa-icf -flto" } */ +/* { dg-options "-O2 -fdump-ipa-icf -flto -fdump-tree-fixup_cfg4" } */ /* { dg-require-effective-target lto } */ /* { dg-additional-sources "ipa-icf-38a.c" }*/ @@ -29,3 +29,5 @@ int main() /* { dg-final { scan-wpa-ipa-dump "Semantic equality hit:foo->bar" "icf" } } */ /* { dg-final { scan-wpa-ipa-dump "Equal symbols: 1" "icf" } } */ +/* { dg-final { scan-ltrans-tree-dump "Function foo" "fixup_cfg4" } } */ +/* { dg-final { scan-ltrans-tree-dump-not "Function bar" "fixup_cfg4" } } */ diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 2fca9e8..a15c5d5 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -21,6 +21,7 @@ load_lib target-supports-dg.exp load_lib scanasm.exp load_lib scanrtl.exp load_lib scantree.exp +load_lib scanltranstree.exp load_lib scanipa.exp load_lib scanwpaipa.exp load_lib scanlang.exp diff --git a/gcc/testsuite/lib/scanltranstree.exp b/gcc/testsuite/lib/scanltranstree.exp new file mode 100644 index 0000000..f536f84 --- /dev/null +++ b/gcc/testsuite/lib/scanltranstree.exp @@ -0,0 +1,148 @@ +# Copyright (C) 2000-2018 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Various utilities for scanning ltrans tree dump output, used by gcc-dg.exp and +# g++-dg.exp. + +load_lib scandump.exp + +# Utility for scanning compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Call pass if pattern is present given number of times, otherwise fail. +# Argument 0 is the regexp to match +# Argument 1 is number of times the regexp must be found +# Argument 2 is the name of the dumped tree pass +# Argument 3 handles expected failures and the like +proc scan-ltrans-tree-dump-times { args } { + + if { [llength $args] < 3 } { + error "scan-ltrans-tree-dump-times: too few arguments" + return + } + if { [llength $args] > 4 } { + error "scan-ltrans-tree-dump-times: too many arguments" + return + } + if { [llength $args] >= 4 } { + scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" \ + ".exe.ltrans0" [lindex $args 3] + } else { + scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" ".exe.ltrans0" + } +} + +# Call pass if pattern is not present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-not { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-not: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-not: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Utility for scanning demangled compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-dem { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-dem: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-dem: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-dem "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump-dem "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Call pass if demangled pattern is not present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-dem-not { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-dem-not: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-dem-not: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-dem-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \ + ".exe.ltrans0" [lindex $args 2] + } else { + scan-dump-dem-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \ + ".exe.ltrans0" + } +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 590b62c..cfc22a2 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8809,6 +8809,26 @@ proc force_conventional_output_for { test } { } } +# Record that dg-final test scan-ltrans-tree-dump* requires -flto-partition=one +# in order to force a single partition, allowing scan-ltrans-tree-dump* to scan +# a dump file *.exe.ltrans0.*. + +proc scan-ltrans-tree-dump_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-times_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-not_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-dem_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-dem-not_required_options {} { + return "-flto-partition=one" +} + # Return 1 if the x86-64 target supports PIE with copy reloc, 0 # otherwise. Cache the result. diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp index 9737758..38f3e56 100644 --- a/libatomic/testsuite/lib/libatomic.exp +++ b/libatomic/testsuite/lib/libatomic.exp @@ -37,6 +37,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib multiline.exp diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 15c459a..c694f17 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -29,6 +29,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp index e9f5f48..b3d247b 100644 --- a/libitm/testsuite/lib/libitm.exp +++ b/libitm/testsuite/lib/libitm.exp @@ -43,6 +43,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp index 540b8ad..4b71c9c 100644 --- a/libvtv/testsuite/lib/libvtv.exp +++ b/libvtv/testsuite/lib/libvtv.exp @@ -42,6 +42,7 @@ load_gcc_lib scanasm.exp load_gcc_lib scandump.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp
On Wed, 2 May 2018, Tom de Vries wrote: > On 04/03/2018 07:49 PM, Bernhard Reutner-Fischer wrote: > > > This patch adds scan-ltrans-tree-dump. > > > > Please check all error calls to talk about the correct function -- at least > > scan-ltrans-tree-dump-times is wrong. > > > > Fixed in this updated patch. > > OK for trunk? OK. Thanks, Richard.
[testsuite] Add scan-ltrans-tree-dump 2018-03-28 Tom de Vries <tom@codesourcery.com> PR testsuite/85106 * gcc.dg/ipa/ipa-icf-38.c: Use scan-ltrans-tree-dump. * lib/scanltranstree.exp: New file. * lib/target-supports.exp (scan-ltrans-tree-dump_required_options) (scan-ltrans-tree-dump-times_required_options) (scan-ltrans-tree-dump-not_required_options) (scan-ltrans-tree-dump-dem_required_options) (scan-ltrans-tree-dump-dem-not_required_options): New proc. * lib/gcc-dg.exp: Include scanltranstree.exp. * testsuite/lib/libatomic.exp: Include scanltranstree.exp. * testsuite/lib/libgomp.exp: Include scanltranstree.exp. * testsuite/lib/libitm.exp: Include scanltranstree.exp. * testsuite/lib/libvtv.exp: Include scanltranstree.exp. * doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization dump files): Add ltrans-tree. --- gcc/doc/sourcebuild.texi | 4 +- gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c | 4 +- gcc/testsuite/lib/gcc-dg.exp | 1 + gcc/testsuite/lib/scanltranstree.exp | 148 ++++++++++++++++++++++++++++++++++ gcc/testsuite/lib/target-supports.exp | 20 +++++ libatomic/testsuite/lib/libatomic.exp | 1 + libgomp/testsuite/lib/libgomp.exp | 1 + libitm/testsuite/lib/libitm.exp | 1 + libvtv/testsuite/lib/libvtv.exp | 1 + 9 files changed, 178 insertions(+), 3 deletions(-) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index db98e9f..8ef2d0e 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2595,8 +2595,8 @@ assembly output. @subsubsection Scan optimization dump files -These commands are available for @var{kind} of @code{tree}, @code{rtl}, -@code{ipa}, and @code{wpa-ipa}. +These commands are available for @var{kind} of @code{tree}, @code{ltrans-tree}, +@code{rtl}, @code{ipa}, and @code{wpa-ipa}. @table @code @item scan-@var{kind}-dump @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}] diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c index 6e7936a..85531ab 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c @@ -1,5 +1,5 @@ /* { dg-do link } */ -/* { dg-options "-O2 -fdump-ipa-icf -flto" } */ +/* { dg-options "-O2 -fdump-ipa-icf -flto -fdump-tree-fixup_cfg4" } */ /* { dg-require-effective-target lto } */ /* { dg-additional-sources "ipa-icf-38a.c" }*/ @@ -29,3 +29,5 @@ int main() /* { dg-final { scan-wpa-ipa-dump "Semantic equality hit:foo->bar" "icf" } } */ /* { dg-final { scan-wpa-ipa-dump "Equal symbols: 1" "icf" } } */ +/* { dg-final { scan-ltrans-tree-dump "Function foo" "fixup_cfg4" } } */ +/* { dg-final { scan-ltrans-tree-dump-not "Function bar" "fixup_cfg4" } } */ diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 2fca9e8..a15c5d5 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -21,6 +21,7 @@ load_lib target-supports-dg.exp load_lib scanasm.exp load_lib scanrtl.exp load_lib scantree.exp +load_lib scanltranstree.exp load_lib scanipa.exp load_lib scanwpaipa.exp load_lib scanlang.exp diff --git a/gcc/testsuite/lib/scanltranstree.exp b/gcc/testsuite/lib/scanltranstree.exp new file mode 100644 index 0000000..c122abb --- /dev/null +++ b/gcc/testsuite/lib/scanltranstree.exp @@ -0,0 +1,148 @@ +# Copyright (C) 2000-2018 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 GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# Various utilities for scanning ltrans tree dump output, used by gcc-dg.exp and +# g++-dg.exp. + +load_lib scandump.exp + +# Utility for scanning compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Call pass if pattern is present given number of times, otherwise fail. +# Argument 0 is the regexp to match +# Argument 1 is number of times the regexp must be found +# Argument 2 is the name of the dumped tree pass +# Argument 3 handles expected failures and the like +proc scan-ltrans-tree-dump-times { args } { + + if { [llength $args] < 3 } { + error "scan-ltrans-tree-dump: too few arguments" + return + } + if { [llength $args] > 4 } { + error "scan-ltrans-tree-dump: too many arguments" + return + } + if { [llength $args] >= 4 } { + scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" \ + ".exe.ltrans0" [lindex $args 3] + } else { + scan-dump-times "ltrans-tree" [lindex $args 0] [lindex $args 1] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" ".exe.ltrans0" + } +} + +# Call pass if pattern is not present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-not { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-not: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-not: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Utility for scanning demangled compiler result, invoked via dg-final. +# Call pass if pattern is present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-dem { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-dem: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-dem: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-dem "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" \ + [lindex $args 2] + } else { + scan-dump-dem "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ".exe.ltrans0" + } +} + +# Call pass if demangled pattern is not present, otherwise fail. +# +# Argument 0 is the regexp to match +# Argument 1 is the name of the dumped tree pass +# Argument 2 handles expected failures and the like +proc scan-ltrans-tree-dump-dem-not { args } { + + if { [llength $args] < 2 } { + error "scan-ltrans-tree-dump-dem-not: too few arguments" + return + } + if { [llength $args] > 3 } { + error "scan-ltrans-tree-dump-dem-not: too many arguments" + return + } + if { [llength $args] >= 3 } { + scan-dump-dem-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \ + ".exe.ltrans0" [lindex $args 2] + } else { + scan-dump-dem-not "ltrans-tree" [lindex $args 0] \ + "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \ + ".exe.ltrans0" + } +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 55e7269..8aec31f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8819,6 +8819,26 @@ proc force_conventional_output_for { test } { } } +# Record that dg-final test scan-ltrans-tree-dump* requires -flto-partition=one +# in order to force a single partition, allowing scan-ltrans-tree-dump* to scan +# a dump file *.exe.ltrans0.*. + +proc scan-ltrans-tree-dump_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-times_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-not_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-dem_required_options {} { + return "-flto-partition=one" +} +proc scan-ltrans-tree-dump-dem-not_required_options {} { + return "-flto-partition=one" +} + # Return 1 if the x86-64 target supports PIE with copy reloc, 0 # otherwise. Cache the result. diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp index 9737758..38f3e56 100644 --- a/libatomic/testsuite/lib/libatomic.exp +++ b/libatomic/testsuite/lib/libatomic.exp @@ -37,6 +37,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib multiline.exp diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp index 15c459a..c694f17 100644 --- a/libgomp/testsuite/lib/libgomp.exp +++ b/libgomp/testsuite/lib/libgomp.exp @@ -29,6 +29,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp index e9f5f48..b3d247b 100644 --- a/libitm/testsuite/lib/libitm.exp +++ b/libitm/testsuite/lib/libitm.exp @@ -43,6 +43,7 @@ load_gcc_lib scandump.exp load_gcc_lib scanlang.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp index 540b8ad..4b71c9c 100644 --- a/libvtv/testsuite/lib/libvtv.exp +++ b/libvtv/testsuite/lib/libvtv.exp @@ -42,6 +42,7 @@ load_gcc_lib scanasm.exp load_gcc_lib scandump.exp load_gcc_lib scanrtl.exp load_gcc_lib scantree.exp +load_gcc_lib scanltranstree.exp load_gcc_lib scanipa.exp load_gcc_lib scanwpaipa.exp load_gcc_lib timeout-dg.exp