From: Nathan Sidwell Date: Mon, 13 Jul 2020 20:37:46 +0000 (-0700) Subject: testsuite: scan-lang-dump-times & scan-lang-dump-not X-Git-Tag: upstream/12.2.0~14883 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=698bad8d4832f1c1250b253d655d8fb537a3d31d;p=platform%2Fupstream%2Fgcc.git 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. --- 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]