]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/lib/scanoffloadrtl.exp
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / lib / scanoffloadrtl.exp
CommitLineData
7adcbafe 1# Copyright (C) 2018-2022 Free Software Foundation, Inc.
9b09e453
TV
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 offloading rtl dump output, used by
18# libgomp.exp.
19
20load_lib scandump.exp
efc16503 21load_lib scanoffload.exp
9b09e453
TV
22
23# Utility for scanning compiler result, invoked via dg-final.
24# Call pass if pattern is present, otherwise fail.
25#
26# Argument 0 is the regexp to match
27# Argument 1 is the name of the dumped rtl pass
28# Argument 2 handles expected failures and the like
29proc scan-offload-rtl-dump { args } {
30
31 if { [llength $args] < 2 } {
32 error "scan-offload-rtl-dump: too few arguments"
33 return
34 }
35 if { [llength $args] > 3 } {
36 error "scan-offload-rtl-dump: too many arguments"
37 return
38 }
39 if { [llength $args] >= 3 } {
efc16503
AO
40 scoff end-1 scan-dump "offload-rtl" [lindex $args 0] \
41 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
42 [lindex $args 2]
9b09e453 43 } else {
efc16503
AO
44 scoff end scan-dump "offload-rtl" [lindex $args 0] \
45 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
9b09e453
TV
46 }
47}
48
49# Call pass if pattern is present given number of times, otherwise fail.
50# Argument 0 is the regexp to match
51# Argument 1 is number of times the regexp must be found
52# Argument 2 is the name of the dumped rtl pass
53# Argument 3 handles expected failures and the like
54proc scan-offload-rtl-dump-times { args } {
55
56 if { [llength $args] < 3 } {
57 error "scan-offload-rtl-dump-times: too few arguments"
58 return
59 }
60 if { [llength $args] > 4 } {
61 error "scan-offload-rtl-dump-times: too many arguments"
62 return
63 }
64 if { [llength $args] >= 4 } {
efc16503
AO
65 scoff end-1 scan-dump-times "offload-rtl" [lindex $args 0] \
66 [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" "" \
9b09e453
TV
67 [lindex $args 3]
68 } else {
efc16503
AO
69 scoff end scan-dump-times "offload-rtl" [lindex $args 0] \
70 [lindex $args 1] "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 2]" ""
9b09e453
TV
71 }
72}
73
74# Call pass if pattern is not present, otherwise fail.
75#
76# Argument 0 is the regexp to match
77# Argument 1 is the name of the dumped rtl pass
78# Argument 2 handles expected failures and the like
79proc scan-offload-rtl-dump-not { args } {
80
81 if { [llength $args] < 2 } {
82 error "scan-offload-rtl-dump-not: too few arguments"
83 return
84 }
85 if { [llength $args] > 3 } {
86 error "scan-offload-rtl-dump-not: too many arguments"
87 return
88 }
89 if { [llength $args] >= 3 } {
efc16503
AO
90 scoff end-1 scan-dump-not "offload-rtl" [lindex $args 0] \
91 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
92 [lindex $args 2]
9b09e453 93 } else {
efc16503
AO
94 scoff end scan-dump-not "offload-rtl" [lindex $args 0] \
95 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
9b09e453
TV
96 }
97}
98
99# Utility for scanning demangled compiler result, invoked via dg-final.
100# Call pass if pattern is present, otherwise fail.
101#
102# Argument 0 is the regexp to match
103# Argument 1 is the name of the dumped rtl pass
104# Argument 2 handles expected failures and the like
105proc scan-offload-rtl-dump-dem { args } {
106
107 if { [llength $args] < 2 } {
108 error "scan-offload-rtl-dump-dem: too few arguments"
109 return
110 }
111 if { [llength $args] > 3 } {
112 error "scan-offload-rtl-dump-dem: too many arguments"
113 return
114 }
115 if { [llength $args] >= 3 } {
efc16503
AO
116 scoff end-1 scan-dump-dem "offload-rtl" [lindex $args 0] \
117 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
118 [lindex $args 2]
9b09e453 119 } else {
efc16503
AO
120 scoff end scan-dump-dem "offload-rtl" [lindex $args 0] \
121 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
9b09e453
TV
122 }
123}
124
125# Call pass if demangled pattern is not present, otherwise fail.
126#
127# Argument 0 is the regexp to match
128# Argument 1 is the name of the dumped rtl pass
129# Argument 2 handles expected failures and the like
130proc scan-offload-rtl-dump-dem-not { args } {
131
132 if { [llength $args] < 2 } {
133 error "scan-offload-rtl-dump-dem-not: too few arguments"
134 return
135 }
136 if { [llength $args] > 3 } {
137 error "scan-offload-rtl-dump-dem-not: too many arguments"
138 return
139 }
140 if { [llength $args] >= 3 } {
efc16503
AO
141 scoff end-1 scan-dump-dem-not "offload-rtl" [lindex $args 0] \
142 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" "" \
143 [lindex $args 2]
9b09e453 144 } else {
efc16503
AO
145 scoff end scan-dump-dem-not "offload-rtl" [lindex $args 0] \
146 "\[0-9\]\[0-9\]\[0-9]r.[lindex $args 1]" ""
9b09e453
TV
147 }
148}