aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-07-13 13:37:46 -0700
committerNathan Sidwell <nathan@acm.org>2020-07-13 13:41:49 -0700
commit698bad8d4832f1c1250b253d655d8fb537a3d31d (patch)
treed673ab26b693aff5c1163211d90abcd267dcc4da /gcc
parent0b12638ba3f00a0c54811d81245128f58b2c2a64 (diff)
downloadgcc-698bad8d4832f1c1250b253d655d8fb537a3d31d.zip
gcc-698bad8d4832f1c1250b253d655d8fb537a3d31d.tar.gz
gcc-698bad8d4832f1c1250b253d655d8fb537a3d31d.tar.bz2
testsuite: scan-lang-dump-times & scan-lang-dump-not
Sigh, last week's success at not breaking things failed with an incorrect 'fix' this morning. Let's reduce my confusion by making lib/scanlang.exp the same on trunk as modules. gcc/testsuite/ * lib/scanlang.exp (scan-lang-dump): Fix breakage. (scan-lang-dump-times, scan-lang-dump-not): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/lib/scanlang.exp50
1 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/scanlang.exp b/gcc/testsuite/lib/scanlang.exp
index d9f8c1e..b85ec68 100644
--- a/gcc/testsuite/lib/scanlang.exp
+++ b/gcc/testsuite/lib/scanlang.exp
@@ -36,6 +36,56 @@ proc scan-lang-dump { args } {
return
}
if { [llength $args] >= 3 } {
+ scan-dump "lang" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" "" [lindex $args 2]
+ } else {
+ scan-dump "lang" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" ""
+ }
+}
+
+# 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-lang-dump-times { args } {
+
+ if { [llength $args] < 3 } {
+ error "scan-lang-dump-times: too few arguments"
+ return
+ }
+ if { [llength $args] > 4 } {
+ error "scan-lang-dump-times: too many arguments"
+ return
+ }
+ if { [llength $args] >= 4 } {
+ scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" "" \
+ [lindex $args 3]
+ } else {
+ scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" ""
+ }
+}
+
+# Utility for scanning compiler result, invoked via dg-final.
+# Call pass if pattern is not present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped lang pass
+# Argument 2 handles expected failures and the like
+proc scan-lang-dump-not { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-lang-dump-not: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-lang-dump-not: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
scan-dump-not "lang" [lindex $args 0] \
"\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" "" \
[lindex $args 2]