summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-05-02 12:16:15 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-05-02 12:16:15 +0000
commit6c3c13c181a168ce3e5e95e6c0fa27ae3730b820 (patch)
tree57e2748564ec4c427e2f42582c2ee983a24f7a94
parent559289370f76bfdb6a2ebfb4315c18206d73027a (diff)
[testsuite] Add scan-wpa-ipa-dump
2018-05-02 Tom de Vries <tom@codesourcery.com> PR testsuite/85106 * gcc.dg/ipa/ipa-icf-38.c: New test. * gcc.dg/ipa/ipa-icf-38a.c: New test. * lib/scandump.exp (dump-base): New proc. (scan-dump, scan-dump-times, scan-dump-not, scan-dump-dem) (scan-dump-dem-not): Add and handle parameter for suffix of the dump base. * lib/scanipa.exp: Add "" argument to scan-dump calls. * lib/scanlang.exp: Same. * lib/scanrtl.exp: Same. * lib/scantree.exp: Same. * lib/scanwpaipa.exp: New file. * lib/gcc-dg.exp: Include scanwpaipa.exp. * testsuite/lib/libatomic.exp: Include scanwpaipa.exp. * testsuite/lib/libgomp.exp: Include scanwpaipa.exp. * testsuite/lib/libitm.exp: Include scanwpaipa.exp. * testsuite/lib/libvtv.exp: Include scanwpaipa.exp. * doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization dump files): Add wpa-ipa. From-SVN: r259837
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/doc/sourcebuild.texi2
-rw-r--r--gcc/testsuite/ChangeLog16
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c31
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c14
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp1
-rw-r--r--gcc/testsuite/lib/scandump.exp63
-rw-r--r--gcc/testsuite/lib/scanipa.exp25
-rw-r--r--gcc/testsuite/lib/scanlang.exp6
-rw-r--r--gcc/testsuite/lib/scanrtl.exp25
-rw-r--r--gcc/testsuite/lib/scantree.exp25
-rw-r--r--gcc/testsuite/lib/scanwpaipa.exp147
-rw-r--r--libatomic/ChangeLog5
-rw-r--r--libatomic/testsuite/lib/libatomic.exp1
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/lib/libgomp.exp1
-rw-r--r--libitm/ChangeLog5
-rw-r--r--libitm/testsuite/lib/libitm.exp1
-rw-r--r--libvtv/ChangeLog5
-rw-r--r--libvtv/testsuite/lib/libvtv.exp1
20 files changed, 332 insertions, 53 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d8ea0f07827..3abedbe019d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * doc/sourcebuild.texi (Commands for use in dg-final, Scan optimization
+ dump files): Add wpa-ipa.
+
2018-05-02 Segher Boessenkool <segher@kernel.crashing.org>
* config.gcc (powerpc*-*-*): Remove paired.h. Unsupport the
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index a1a6c9dc384..ad4f446721d 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2589,7 +2589,7 @@ assembly output.
@subsubsection Scan optimization dump files
These commands are available for @var{kind} of @code{tree}, @code{rtl},
-and @code{ipa}.
+@code{ipa}, and @code{wpa-ipa}.
@table @code
@item scan-@var{kind}-dump @var{regex} @var{suffix} [@{ target/xfail @var{selector} @}]
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6bd3e0fb425..80b6d373d0e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,19 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * gcc.dg/ipa/ipa-icf-38.c: New test.
+ * gcc.dg/ipa/ipa-icf-38a.c: New test.
+ * lib/scandump.exp (dump-base): New proc.
+ (scan-dump, scan-dump-times, scan-dump-not, scan-dump-dem)
+ (scan-dump-dem-not): Add and handle parameter for suffix of the dump
+ base.
+ * lib/scanipa.exp: Add "" argument to scan-dump calls.
+ * lib/scanlang.exp: Same.
+ * lib/scanrtl.exp: Same.
+ * lib/scantree.exp: Same.
+ * lib/scanwpaipa.exp: New file.
+ * lib/gcc-dg.exp: Include scanwpaipa.exp.
+
2018-05-02 Richard Biener <rguenther@suse.de>
PR middle-end/85567
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
new file mode 100644
index 00000000000..6e7936a6a68
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c
@@ -0,0 +1,31 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-ipa-icf -flto" } */
+/* { dg-require-effective-target lto } */
+/* { dg-additional-sources "ipa-icf-38a.c" }*/
+
+/* Based on ipa-icf-3.c. */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+__attribute__ ((noinline))
+int foo(void)
+{
+ v4si a = {1,2,3,4};
+ v4si b = {3,2,1,4};
+ v4si c;
+
+ return 54;
+}
+
+extern int bar(void);
+
+int main()
+{
+ int volatile a = foo();
+ int volatile b = bar();
+
+ return 0;
+}
+
+/* { dg-final { scan-wpa-ipa-dump "Semantic equality hit:foo->bar" "icf" } } */
+/* { dg-final { scan-wpa-ipa-dump "Equal symbols: 1" "icf" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c
new file mode 100644
index 00000000000..414a7c455e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c
@@ -0,0 +1,14 @@
+/* { dg-skip-if "" { *-*-* } } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+__attribute__ ((noinline))
+int bar(void)
+{
+ v4si a = {1,2,3,4};
+ v4si b = {3,2,1,4};
+ v4si c;
+
+ return 54;
+}
+
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 3770f698c46..2fca9e87afc 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -22,6 +22,7 @@ load_lib scanasm.exp
load_lib scanrtl.exp
load_lib scantree.exp
load_lib scanipa.exp
+load_lib scanwpaipa.exp
load_lib scanlang.exp
load_lib timeout.exp
load_lib timeout-dg.exp
diff --git a/gcc/testsuite/lib/scandump.exp b/gcc/testsuite/lib/scandump.exp
index be8fbe8b461..3d42692b539 100644
--- a/gcc/testsuite/lib/scandump.exp
+++ b/gcc/testsuite/lib/scandump.exp
@@ -26,17 +26,31 @@ proc dump-suffix { arg } {
return [string range $arg $idx end]
}
+# Construct the dumpbase.
+# Argument 0 is the src file
+# Argument 1 is the dump base suffix
+proc dump-base { args } {
+ set src [lindex $args 0]
+ set dumpbase_suf [lindex $args 1]
+ set dumpbase $src
+ if { [string length $dumpbase_suf] != 0 } {
+ regsub {[.][^.]*$} $src $dumpbase_suf dumpbase
+ }
+ return $dumpbase
+}
+
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
#
# Argument 0 is the type of dump we are searching (rtl, tree, ipa)
# Argument 1 is the regexp to match.
# Argument 2 is the suffix for the dump file
-# Argument 3 handles expected failures and the like
+# Argument 3 is the suffix of the dump base
+# Argument 4 handles expected failures and the like
proc scan-dump { args } {
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
+ if { [llength $args] >= 5 } {
+ switch [dg-process-target [lindex $args 4]] {
"S" { }
"N" { return }
"F" { setup_xfail "*-*-*" }
@@ -52,7 +66,8 @@ proc scan-dump { args } {
set suf [dump-suffix [lindex $args 2]]
set testname "$testcase scan-[lindex $args 0]-dump $suf \"$printable_pattern\""
set src [file tail $filename]
- set output_file "[glob -nocomplain $src.[lindex $args 2]]"
+ set dumpbase [dump-base $src [lindex $args 3]]
+ set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
@@ -75,11 +90,12 @@ proc scan-dump { args } {
# Argument 1 is the regexp to match.
# Argument 2 is number of times the regexp must be found
# Argument 3 is the suffix for the dump file
-# Argument 4 handles expected failures and the like
+# Argument 4 is the suffix of the dump base
+# Argument 5 handles expected failures and the like
proc scan-dump-times { args } {
- if { [llength $args] >= 5 } {
- switch [dg-process-target [lindex $args 4]] {
+ if { [llength $args] >= 6 } {
+ switch [dg-process-target [lindex $args 5]] {
"S" { }
"N" { return }
"F" { setup_xfail "*-*-*" }
@@ -95,7 +111,8 @@ proc scan-dump-times { args } {
set printable_pattern [make_pattern_printable [lindex $args 1]]
set testname "$testcase scan-[lindex $args 0]-dump-times $suf \"$printable_pattern\" [lindex $args 2]"
set src [file tail $filename]
- set output_file "[glob -nocomplain $src.[lindex $args 3]]"
+ set dumpbase [dump-base $src [lindex $args 4]]
+ set output_file "[glob -nocomplain $dumpbase.[lindex $args 3]]"
if { $output_file == "" } {
verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
@@ -120,11 +137,12 @@ proc scan-dump-times { args } {
# Argument 0 is the type of dump we are searching (rtl, tree, ipa)
# Argument 1 is the regexp to match.
# Argument 2 is the suffix for the dump file
-# Argument 3 handles expected failures and the like
+# Argument 3 is the suffix of the dump base
+# Argument 4 handles expected failures and the like
proc scan-dump-not { args } {
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
+ if { [llength $args] >= 5 } {
+ switch [dg-process-target [lindex $args 4]] {
"S" { }
"N" { return }
"F" { setup_xfail "*-*-*" }
@@ -139,7 +157,8 @@ proc scan-dump-not { args } {
set suf [dump-suffix [lindex $args 2]]
set testname "$testcase scan-[lindex $args 0]-dump-not $suf \"$printable_pattern\""
set src [file tail $filename]
- set output_file "[glob -nocomplain $src.[lindex $args 2]]"
+ set dumpbase [dump-base $src [lindex $args 3]]
+ set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
@@ -163,13 +182,14 @@ proc scan-dump-not { args } {
# Argument 0 is the type of dump we are searching (rtl, tree, ipa)
# Argument 1 is the regexp to match.
# Argument 2 is the suffix for the dump file
-# Argument 3 handles expected failures and the like
+# Argument 3 is the suffix of the dump base
+# Argument 4 handles expected failures and the like
proc scan-dump-dem { args } {
global cxxfilt
global base_dir
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
+ if { [llength $args] >= 5 } {
+ switch [dg-process-target [lindex $args 4]] {
"S" { }
"N" { return }
"F" { setup_xfail "*-*-*" }
@@ -194,7 +214,8 @@ proc scan-dump-dem { args } {
set suf [dump-suffix [lindex $args 2]]
set testname "$testcase scan-[lindex $args 0]-dump-dem $suf \"$printable_pattern\""
set src [file tail $filename]
- set output_file "[glob -nocomplain $src.[lindex $args 2]]"
+ set dumpbase [dump-base $src [lindex $args 3]]
+ set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
@@ -217,13 +238,14 @@ proc scan-dump-dem { args } {
# Argument 0 is the type of dump we are searching (rtl, tree, ipa)
# Argument 1 is the regexp to match.
# Argument 2 is the suffix for the dump file
-# Argument 3 handles expected failures and the like
+# Argument 3 is the suffix of the dump base
+# Argument 4 handles expected failures and the like
proc scan-dump-dem-not { args } {
global cxxfilt
global base_dir
- if { [llength $args] >= 4 } {
- switch [dg-process-target [lindex $args 3]] {
+ if { [llength $args] >= 5 } {
+ switch [dg-process-target [lindex $args 4]] {
"S" { }
"N" { return }
"F" { setup_xfail "*-*-*" }
@@ -248,7 +270,8 @@ proc scan-dump-dem-not { args } {
set suf [dump-suffix [lindex $args 2]]
set testname "$testcase scan-[lindex $args 0]-dump-dem-not $suf \"$printable_pattern\""
set src [file tail $filename]
- set output_file "[glob -nocomplain $src.[lindex $args 2]]"
+ set dumpbase [dump-base $src [lindex $args 3]]
+ set output_file "[glob -nocomplain $dumpbase.[lindex $args 2]]"
if { $output_file == "" } {
verbose -log "$testcase: dump file does not exist"
unresolved "$testname"
diff --git a/gcc/testsuite/lib/scanipa.exp b/gcc/testsuite/lib/scanipa.exp
index 3e2f1a45cde..68f1ae36fc3 100644
--- a/gcc/testsuite/lib/scanipa.exp
+++ b/gcc/testsuite/lib/scanipa.exp
@@ -36,9 +36,11 @@ proc scan-ipa-dump { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
+ scan-dump "ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" "" [lindex $args 2]
} else {
- scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
+ scan-dump "ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ""
}
}
@@ -59,10 +61,11 @@ proc scan-ipa-dump-times { args } {
}
if { [llength $args] >= 4 } {
scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" [lindex $args 3]
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" "" \
+ [lindex $args 3]
} else {
scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ""
}
}
@@ -83,10 +86,11 @@ proc scan-ipa-dump-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-not "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-not "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ""
}
}
@@ -108,10 +112,11 @@ proc scan-ipa-dump-dem { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-dem "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ""
}
}
@@ -132,10 +137,10 @@ proc scan-ipa-dump-dem-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem-not "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" "" \
[lindex $args 2]
} else {
scan-dump-dem-not "ipa" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scanlang.exp b/gcc/testsuite/lib/scanlang.exp
index 856ceb89d52..3c8bf64fa76 100644
--- a/gcc/testsuite/lib/scanlang.exp
+++ b/gcc/testsuite/lib/scanlang.exp
@@ -36,8 +36,10 @@ 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]
+ 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]"
+ scan-dump "lang" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]l.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scanrtl.exp b/gcc/testsuite/lib/scanrtl.exp
index fea3d80d274..d744e7da6d9 100644
--- a/gcc/testsuite/lib/scanrtl.exp
+++ b/gcc/testsuite/lib/scanrtl.exp
@@ -36,9 +36,11 @@ proc scan-rtl-dump { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump "rtl" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" [lindex $args 2]
+ scan-dump "rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" "" [lindex $args 2]
} else {
- scan-dump "rtl" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]"
+ scan-dump "rtl" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" ""
}
}
@@ -61,10 +63,11 @@ proc scan-rtl-dump-times { args } {
}
if { [llength $args] >= 4 } {
scan-dump-times "rtl" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 2]" [lindex $args 3]
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 2]" "" \
+ [lindex $args 3]
} else {
scan-dump-times "rtl" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 2]"
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 2]" ""
}
}
@@ -87,10 +90,11 @@ proc scan-rtl-dump-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-not "rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-not "rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" ""
}
}
@@ -114,10 +118,11 @@ proc scan-rtl-dump-dem { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem "rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-dem "rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" ""
}
}
@@ -141,10 +146,10 @@ proc scan-rtl-dump-dem-not { args } {
if { [llength $args] >= 3 } {
scan-dump-dem-not "rtl" [lindex $args 0] \
"\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" \
- [lindex $args 2]
+ "" [lindex $args 2]
} else {
scan-dump-dem-not "rtl" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]r.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scantree.exp b/gcc/testsuite/lib/scantree.exp
index 8dcc4d00783..e66337a0ccf 100644
--- a/gcc/testsuite/lib/scantree.exp
+++ b/gcc/testsuite/lib/scantree.exp
@@ -36,9 +36,11 @@ proc scan-tree-dump { args } {
return
}
if { [llength $args] >= 3 } {
- scan-dump "tree" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" [lindex $args 2]
+ scan-dump "tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" "" [lindex $args 2]
} else {
- scan-dump "tree" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]"
+ scan-dump "tree" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ""
}
}
@@ -59,10 +61,11 @@ proc scan-tree-dump-times { args } {
}
if { [llength $args] >= 4 } {
scan-dump-times "tree" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" [lindex $args 3]
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" "" \
+ [lindex $args 3]
} else {
scan-dump-times "tree" [lindex $args 0] [lindex $args 1] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 2]" ""
}
}
@@ -83,10 +86,11 @@ proc scan-tree-dump-not { args } {
}
if { [llength $args] >= 3 } {
scan-dump-not "tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-not "tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ""
}
}
@@ -108,10 +112,11 @@ proc scan-tree-dump-dem { args } {
}
if { [llength $args] >= 3 } {
scan-dump-dem "tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" [lindex $args 2]
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" "" \
+ [lindex $args 2]
} else {
scan-dump-dem "tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ""
}
}
@@ -133,9 +138,9 @@ proc scan-tree-dump-dem-not { args } {
if { [llength $args] >= 3 } {
scan-dump-dem-not "tree" [lindex $args 0] \
"\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" \
- [lindex $args 2]
+ "" [lindex $args 2]
} else {
scan-dump-dem-not "tree" [lindex $args 0] \
- "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]"
+ "\[0-9\]\[0-9\]\[0-9\]t.[lindex $args 1]" ""
}
}
diff --git a/gcc/testsuite/lib/scanwpaipa.exp b/gcc/testsuite/lib/scanwpaipa.exp
new file mode 100644
index 00000000000..5ad40bf0340
--- /dev/null
+++ b/gcc/testsuite/lib/scanwpaipa.exp
@@ -0,0 +1,147 @@
+# Copyright (C) 2018 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Various utilities for scanning ipa dump output, used by gcc-dg.exp and
+# g++-dg.exp.
+
+load_lib scandump.exp
+
+# Utility for scanning compiler result, invoked via dg-final.
+# Call pass if pattern is present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped ipa pass
+# Argument 2 handles expected failures and the like
+proc scan-wpa-ipa-dump { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-wpa-ipa-dump: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-wpa-ipa-dump: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ scan-dump "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ [lindex $args 2]
+ } else {
+ scan-dump "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ }
+}
+
+# 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 ipa pass
+# Argument 3 handles expected failures and the like
+proc scan-wpa-ipa-dump-times { args } {
+
+ if { [llength $args] < 3 } {
+ error "scan-wpa-ipa-dump-times: too few arguments"
+ return
+ }
+ if { [llength $args] > 4 } {
+ error "scan-wpa-ipa-dump-times: too many arguments"
+ return
+ }
+ if { [llength $args] >= 4 } {
+ scan-dump-times "wpa-ipa" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa" \
+ [lindex $args 3]
+ } else {
+ scan-dump-times "wpa-ipa" [lindex $args 0] [lindex $args 1] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" ".exe.wpa"
+ }
+}
+
+# Call pass if pattern is not present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped ipa pass
+# Argument 2 handles expected failures and the like
+proc scan-wpa-ipa-dump-not { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-wpa-ipa-dump-not: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-wpa-ipa-dump-not: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ scan-dump-not "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ [lindex $args 2]
+ } else {
+ scan-dump-not "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ }
+}
+
+# Utility for scanning demangled compiler result, invoked via dg-final.
+# Call pass if pattern is present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped ipa pass
+# Argument 2 handles expected failures and the like
+proc scan-wpa-ipa-dump-dem { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-wpa-ipa-dump-dem: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-wpa-ipa-dump-dem: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ scan-dump-dem "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ [lindex $args 2]
+ } else {
+ scan-dump-dem "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ }
+}
+
+# Call pass if demangled pattern is not present, otherwise fail.
+#
+# Argument 0 is the regexp to match
+# Argument 1 is the name of the dumped ipa pass
+# Argument 2 handles expected failures and the like
+proc scan-wpa-ipa-dump-dem-not { args } {
+
+ if { [llength $args] < 2 } {
+ error "scan-wpa-ipa-dump-dem-not: too few arguments"
+ return
+ }
+ if { [llength $args] > 3 } {
+ error "scan-wpa-ipa-dump-dem-not: too many arguments"
+ return
+ }
+ if { [llength $args] >= 3 } {
+ scan-dump-dem-not "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa" \
+ [lindex $args 2]
+ } else {
+ scan-dump-dem-not "wpa-ipa" [lindex $args 0] \
+ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" ".exe.wpa"
+ }
+}
diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog
index 3d78f33d71a..70761047cbc 100644
--- a/libatomic/ChangeLog
+++ b/libatomic/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * testsuite/lib/libatomic.exp: Include scanwpaipa.exp.
+
2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.
diff --git a/libatomic/testsuite/lib/libatomic.exp b/libatomic/testsuite/lib/libatomic.exp
index 0a53f9e11f1..9737758f549 100644
--- a/libatomic/testsuite/lib/libatomic.exp
+++ b/libatomic/testsuite/lib/libatomic.exp
@@ -38,6 +38,7 @@ load_gcc_lib scanlang.exp
load_gcc_lib scanrtl.exp
load_gcc_lib scantree.exp
load_gcc_lib scanipa.exp
+load_gcc_lib scanwpaipa.exp
load_gcc_lib multiline.exp
load_gcc_lib prune.exp
load_gcc_lib target-libpath.exp
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 49364dac094..e9799b132e0 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * testsuite/lib/libgomp.exp: Include scanwpaipa.exp.
+
2018-04-29 Julian Brown <julian@codesourcery.com>
Tom de Vries <tom@codesourcery.com>
diff --git a/libgomp/testsuite/lib/libgomp.exp b/libgomp/testsuite/lib/libgomp.exp
index ea3da2cb383..15c459abe14 100644
--- a/libgomp/testsuite/lib/libgomp.exp
+++ b/libgomp/testsuite/lib/libgomp.exp
@@ -30,6 +30,7 @@ load_gcc_lib scanlang.exp
load_gcc_lib scanrtl.exp
load_gcc_lib scantree.exp
load_gcc_lib scanipa.exp
+load_gcc_lib scanwpaipa.exp
load_gcc_lib timeout-dg.exp
load_gcc_lib torture-options.exp
load_gcc_lib fortran-modules.exp
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index fe49453770a..dc729709af7 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * testsuite/lib/libitm.exp: Include scanwpaipa.exp.
+
2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
* config/x86/sjlj.S (_ITM_beginTransaction): Add
diff --git a/libitm/testsuite/lib/libitm.exp b/libitm/testsuite/lib/libitm.exp
index b3c7eb94f94..e9f5f48fd80 100644
--- a/libitm/testsuite/lib/libitm.exp
+++ b/libitm/testsuite/lib/libitm.exp
@@ -44,6 +44,7 @@ load_gcc_lib scanlang.exp
load_gcc_lib scanrtl.exp
load_gcc_lib scantree.exp
load_gcc_lib scanipa.exp
+load_gcc_lib scanwpaipa.exp
load_gcc_lib timeout-dg.exp
load_gcc_lib torture-options.exp
load_gcc_lib fortran-modules.exp
diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog
index 1f163c244d0..b76651dcc79 100644
--- a/libvtv/ChangeLog
+++ b/libvtv/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-02 Tom de Vries <tom@codesourcery.com>
+
+ PR testsuite/85106
+ * testsuite/lib/libvtv.exp: Include scanwpaipa.exp.
+
2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated.
diff --git a/libvtv/testsuite/lib/libvtv.exp b/libvtv/testsuite/lib/libvtv.exp
index edf5fddbad2..540b8adde3b 100644
--- a/libvtv/testsuite/lib/libvtv.exp
+++ b/libvtv/testsuite/lib/libvtv.exp
@@ -43,6 +43,7 @@ load_gcc_lib scandump.exp
load_gcc_lib scanrtl.exp
load_gcc_lib scantree.exp
load_gcc_lib scanipa.exp
+load_gcc_lib scanwpaipa.exp
load_gcc_lib timeout-dg.exp
load_gcc_lib torture-options.exp
load_gcc_lib fortran-modules.exp