aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAlex Coplan <alex.coplan@arm.com>2024-08-27 16:51:12 +0000
committerAlex Coplan <alex.coplan@arm.com>2024-08-28 12:18:47 +0100
commit3f51f0dc88ec21c1ec79df694200f10ef85915f4 (patch)
tree76c661e0695464322ada3378dabf7c6f4fec45b7 /gcc
parent2c0b574ac6a2d01b099fcb60e46414e96b93f0a9 (diff)
downloadgcc-3f51f0dc88ec21c1ec79df694200f10ef85915f4.zip
gcc-3f51f0dc88ec21c1ec79df694200f10ef85915f4.tar.gz
gcc-3f51f0dc88ec21c1ec79df694200f10ef85915f4.tar.bz2
testsuite: Add scan-ltrans-rtl* for use in dg-final [PR116140]
This extends the scan-ltrans-tree* helpers to create RTL variants. This is needed to check the behaviour of an RTL pass under LTO. gcc/ChangeLog: PR libstdc++/116140 * doc/sourcebuild.texi: Document ltrans-rtl value of kind for scan-<kind>-dump*. gcc/testsuite/ChangeLog: PR libstdc++/116140 * lib/scanltranstree.exp (scan-ltrans-rtl-dump): New. (scan-ltrans-rtl-dump-not): New. (scan-ltrans-rtl-dump-dem): New. (scan-ltrans-rtl-dump-dem-not): New. (scan-ltrans-rtl-dump-times): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/doc/sourcebuild.texi4
-rw-r--r--gcc/testsuite/lib/scanltranstree.exp80
2 files changed, 39 insertions, 45 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 3c55f10..0636fc0 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -3627,8 +3627,8 @@ stands for zero or more unmatched lines; the whitespace after
@subsubsection Scan optimization dump files
These commands are available for @var{kind} of @code{tree}, @code{ltrans-tree},
-@code{offload-tree}, @code{rtl}, @code{offload-rtl}, @code{ipa},
-@code{offload-ipa}, and @code{wpa-ipa}.
+@code{offload-tree}, @code{rtl}, @code{ltrans-rtl}, @code{offload-rtl},
+@code{ipa}, @code{offload-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/lib/scanltranstree.exp b/gcc/testsuite/lib/scanltranstree.exp
index bc6e02d..a7d4de3 100644
--- a/gcc/testsuite/lib/scanltranstree.exp
+++ b/gcc/testsuite/lib/scanltranstree.exp
@@ -19,50 +19,44 @@
load_lib scandump.exp
-# The first item in the list is an LTO equivalent of the second item
-# in the list; see the documentation of the second item for details.
-foreach { name scan type suffix } {
- scan-ltrans-tree-dump scan-dump ltrans-tree t
- scan-ltrans-tree-dump-not scan-dump-not ltrans-tree t
- scan-ltrans-tree-dump-dem scan-dump-dem ltrans-tree t
- scan-ltrans-tree-dump-dem-not scan-dump-dem-not ltrans-tree t
-} {
- eval [string map [list @NAME@ $name \
- @SCAN@ $scan \
- @TYPE@ $type \
- @SUFFIX@ $suffix] {
- proc @NAME@ { args } {
- if { [llength $args] < 2 } {
- error "@NAME@: too few arguments"
- return
- }
- if { [llength $args] > 3 } {
- error "@NAME@: too many arguments"
- return
+# Define scan-ltrans-{tree,rtl}-dump{,-not,-dem,-dem-not}. These are LTO
+# variants of the corresponding functions without -ltrans in the name.
+foreach ir { tree rtl } {
+ foreach modifier { {} -not -dem -dem-not } {
+ eval [string map [list @NAME@ scan-ltrans-$ir-dump$modifier \
+ @SCAN@ scan$modifier \
+ @TYPE@ ltrans-$ir \
+ @SUFFIX@ [string index $ir 0]] {
+ proc @NAME@ { args } {
+ if { [llength $args] < 2 } {
+ error "@NAME@: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "@NAME@: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ @SCAN@ @TYPE@ [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 1]" \
+ ".ltrans0.ltrans" \
+ [lindex $args 2]
+ } else {
+ @SCAN@ @TYPE@ [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 1]" \
+ ".ltrans0.ltrans"
+ }
}
- if { [llength $args] >= 3 } {
- @SCAN@ @TYPE@ [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 1]" \
- ".ltrans0.ltrans" \
- [lindex $args 2]
- } else {
- @SCAN@ @TYPE@ [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 1]" \
- ".ltrans0.ltrans"
- }
- }
- }]
+ }]
+ }
}
-# The first item in the list is an LTO equivalent of the second item
-# in the list; see the documentation of the second item for details.
-foreach { name scan type suffix } {
- scan-ltrans-tree-dump-times scan-dump-times ltrans-tree t
-} {
- eval [string map [list @NAME@ $name \
- @SCAN@ $scan \
- @TYPE@ $type \
- @SUFFIX@ $suffix] {
+# Define scan-ltrans-{tree,rtl}-dump-times. These are LTO variants of the
+# corresponding functions without -ltrans in the name.
+foreach ir { tree rtl } {
+ eval [string map [list @NAME@ scan-ltrans-$ir-dump-times \
+ @TYPE@ ltrans-$ir \
+ @SUFFIX@ [string index $ir 0]] {
proc @NAME@ { args } {
if { [llength $args] < 3 } {
error "@NAME@: too few arguments"
@@ -73,11 +67,11 @@ foreach { name scan type suffix } {
return
}
if { [llength $args] >= 4 } {
- @SCAN@ "@TYPE@" [lindex $args 0] [lindex $args 1] \
+ scan-dump-times "@TYPE@" [lindex $args 0] [lindex $args 1] \
"\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 2]" \
".ltrans0.ltrans" [lindex $args 3]
} else {
- @SCAN@ "@TYPE@" [lindex $args 0] [lindex $args 1] \
+ scan-dump-times "@TYPE@" [lindex $args 0] [lindex $args 1] \
"\[0-9\]\[0-9\]\[0-9\]@SUFFIX@.[lindex $args 2]" \
".ltrans0.ltrans"
}