]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/lib/scanlang.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / lib / scanlang.exp
1 # Copyright (C) 2000-2021 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
16
17 # Various utilities for scanning tree dump output, used by gcc-dg.exp and
18 # g++-dg.exp.
19
20 load_lib scandump.exp
21
22 # Utility for scanning compiler result, invoked via dg-final.
23 # Call pass if pattern is present, otherwise fail.
24 #
25 # Argument 0 is the regexp to match
26 # Argument 1 is the name of the dumped lang pass
27 # Argument 2 handles expected failures and the like
28 proc scan-lang-dump { args } {
29
30 if { [llength $args] < 2 } {
31 error "scan-lang-dump: too few arguments"
32 return
33 }
34 if { [llength $args] > 3 } {
35 error "scan-lang-dump: too many arguments"
36 return
37 }
38 if { [llength $args] >= 3 } {
39 scan-dump "lang" [lindex $args 0] \
40 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" "" [lindex $args 2]
41 } else {
42 scan-dump "lang" [lindex $args 0] \
43 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" ""
44 }
45 }
46
47 # Call pass if pattern is present given number of times, otherwise fail.
48 # Argument 0 is the regexp to match
49 # Argument 1 is number of times the regexp must be found
50 # Argument 2 is the name of the dumped tree pass
51 # Argument 3 handles expected failures and the like
52 proc scan-lang-dump-times { args } {
53
54 if { [llength $args] < 3 } {
55 error "scan-lang-dump-times: too few arguments"
56 return
57 }
58 if { [llength $args] > 4 } {
59 error "scan-lang-dump-times: too many arguments"
60 return
61 }
62 if { [llength $args] >= 4 } {
63 scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
64 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" "" \
65 [lindex $args 3]
66 } else {
67 scan-dump-times "lang" [lindex $args 0] [lindex $args 1] \
68 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 2]" ""
69 }
70 }
71
72 # Utility for scanning compiler result, invoked via dg-final.
73 # Call pass if pattern is not present, otherwise fail.
74 #
75 # Argument 0 is the regexp to match
76 # Argument 1 is the name of the dumped lang pass
77 # Argument 2 handles expected failures and the like
78 proc scan-lang-dump-not { args } {
79
80 if { [llength $args] < 2 } {
81 error "scan-lang-dump-not: too few arguments"
82 return
83 }
84 if { [llength $args] > 3 } {
85 error "scan-lang-dump-not: too many arguments"
86 return
87 }
88 if { [llength $args] >= 3 } {
89 scan-dump-not "lang" [lindex $args 0] \
90 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" "" \
91 [lindex $args 2]
92 } else {
93 scan-dump-not "lang" [lindex $args 0] \
94 "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]"
95 }
96 }