1 # Copyright
(C
) 2018-2019 Free Software Foundation
, Inc.
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.
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.
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
/>.
17 # Various utilities
for scanning ipa dump output
, used by gcc
-dg.exp and
22 # Utility
for scanning compiler result
, invoked via dg
-final.
23 #
Call pass
if pattern is present
, otherwise fail.
25 #
Argument 0 is the regexp to match
26 #
Argument 1 is the
name of the dumped ipa pass
27 #
Argument 2 handles expected failures and the like
28 proc scan
-wpa
-ipa
-dump
{ args } {
30 if { [llength $
args] < 2 } {
31 error
"scan-wpa-ipa-dump: too few arguments"
34 if { [llength $
args] > 3 } {
35 error
"scan-wpa-ipa-dump: too many arguments"
38 if { [llength $
args] >= 3 } {
39 scan
-dump
"wpa-ipa" [lindex $args 0] \
40 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
43 scan
-dump
"wpa-ipa" [lindex $args 0] \
44 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
48 #
Call pass
if pattern is present given number of times
, otherwise fail.
49 #
Argument 0 is the regexp to match
50 #
Argument 1 is number of times the regexp must be found
51 #
Argument 2 is the
name of the dumped ipa pass
52 #
Argument 3 handles expected failures and the like
53 proc scan
-wpa
-ipa
-dump
-times
{ args } {
55 if { [llength $
args] < 3 } {
56 error
"scan-wpa-ipa-dump-times: too few arguments"
59 if { [llength $
args] > 4 } {
60 error
"scan-wpa-ipa-dump-times: too many arguments"
63 if { [llength $
args] >= 4 } {
64 scan
-dump
-times
"wpa-ipa" [lindex $args 0] [lindex $args 1] \
65 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa" \
68 scan
-dump
-times
"wpa-ipa" [lindex $args 0] [lindex $args 1] \
69 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa"
73 #
Call pass
if pattern is not present
, otherwise fail.
75 #
Argument 0 is the regexp to match
76 #
Argument 1 is the
name of the dumped ipa pass
77 #
Argument 2 handles expected failures and the like
78 proc scan
-wpa
-ipa
-dump
-not
{ args } {
80 if { [llength $
args] < 2 } {
81 error
"scan-wpa-ipa-dump-not: too few arguments"
84 if { [llength $
args] > 3 } {
85 error
"scan-wpa-ipa-dump-not: too many arguments"
88 if { [llength $
args] >= 3 } {
89 scan
-dump
-not
"wpa-ipa" [lindex $args 0] \
90 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
93 scan
-dump
-not
"wpa-ipa" [lindex $args 0] \
94 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
98 # Utility
for scanning demangled compiler result
, invoked via dg
-final.
99 #
Call pass
if pattern is present
, otherwise fail.
101 #
Argument 0 is the regexp to match
102 #
Argument 1 is the
name of the dumped ipa pass
103 #
Argument 2 handles expected failures and the like
104 proc scan
-wpa
-ipa
-dump
-dem
{ args } {
106 if { [llength $
args] < 2 } {
107 error
"scan-wpa-ipa-dump-dem: too few arguments"
110 if { [llength $
args] > 3 } {
111 error
"scan-wpa-ipa-dump-dem: too many arguments"
114 if { [llength $
args] >= 3 } {
115 scan
-dump
-dem
"wpa-ipa" [lindex $args 0] \
116 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
119 scan
-dump
-dem
"wpa-ipa" [lindex $args 0] \
120 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
124 #
Call pass
if demangled pattern is not present
, otherwise fail.
126 #
Argument 0 is the regexp to match
127 #
Argument 1 is the
name of the dumped ipa pass
128 #
Argument 2 handles expected failures and the like
129 proc scan
-wpa
-ipa
-dump
-dem
-not
{ args } {
131 if { [llength $
args] < 2 } {
132 error
"scan-wpa-ipa-dump-dem-not: too few arguments"
135 if { [llength $
args] > 3 } {
136 error
"scan-wpa-ipa-dump-dem-not: too many arguments"
139 if { [llength $
args] >= 3 } {
140 scan
-dump
-dem
-not
"wpa-ipa" [lindex $args 0] \
141 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
144 scan
-dump
-dem
-not
"wpa-ipa" [lindex $args 0] \
145 "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"