]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[testsuite] Add scan-wpa-ipa-dump
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 May 2018 12:16:15 +0000 (12:16 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 May 2018 12:16:15 +0000 (12:16 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259837 138bc75d-0d04-0410-961f-82ee72b054a4

20 files changed:
gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c [new file with mode: 0644]
gcc/testsuite/lib/gcc-dg.exp
gcc/testsuite/lib/scandump.exp
gcc/testsuite/lib/scanipa.exp
gcc/testsuite/lib/scanlang.exp
gcc/testsuite/lib/scanrtl.exp
gcc/testsuite/lib/scantree.exp
gcc/testsuite/lib/scanwpaipa.exp [new file with mode: 0644]
libatomic/ChangeLog
libatomic/testsuite/lib/libatomic.exp
libgomp/ChangeLog
libgomp/testsuite/lib/libgomp.exp
libitm/ChangeLog
libitm/testsuite/lib/libitm.exp
libvtv/ChangeLog
libvtv/testsuite/lib/libvtv.exp

index d8ea0f078271e7a2308ab6cfbe93899234f1df8a..3abedbe019dd09f252e2a15276c8bc48ec0fd6c2 100644 (file)
@@ -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
index a1a6c9dc384fc1c41e3a21c7756b24c695526319..ad4f446721d7b307b814645f25baaeb5b6765dcf 100644 (file)
@@ -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} @}]
index 6bd3e0fb4256f31ddc40338049e9d24ee5b291dc..80b6d373d0ef52e3077e970b33ed2dab025c3d4e 100644 (file)
@@ -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 (file)
index 0000000..6e7936a
--- /dev/null
@@ -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 (file)
index 0000000..414a7c4
--- /dev/null
@@ -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;
+}
+
index 3770f698c46f2aa2fe9929c9d3afc074d7bdcc1b..2fca9e87afcd52d53657fe02de26570c91ab0717 100644 (file)
@@ -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
index be8fbe8b461dc81d5683fe323c0913f678daa1e0..3d42692b5399f4ab9d1cc8c2caf0cf434ce1bef3 100644 (file)
@@ -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"
index 3e2f1a45cde1201ed6c5d78a36f6394a5248a289..68f1ae36fc3007502625096c66b24297fe87ec9c 100644 (file)
@@ -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]" ""
     }
 }
index 856ceb89d52aa72490b45d353b5ef3f0df91e4f9..3c8bf64fa768c63728e36260acfec3970c3144bf 100644 (file)
@@ -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]" ""
     }
 }
index fea3d80d274f95fcb75d2198779a953de575702d..d744e7da6d986074c80363422666d80402562d00 100644 (file)
@@ -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]" ""
     }
 }
 
index 8dcc4d007831e6b6f59853f55b8e1a4bb30f02fb..e66337a0ccfeec8175498f078cd4e128af2cc2a8 100644 (file)
@@ -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 (file)
index 0000000..5ad40bf
--- /dev/null
@@ -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"
+    }
+}
index 3d78f33d71a675cda4a2e7fbcde675aee87bb1f3..70761047cbc5308bfe1011e4f8c5feb2b6b19a3a 100644 (file)
@@ -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.
index 0a53f9e11f1bf00a953f007fb7a29894ceb8c494..9737758f5495fac69a6ae64b2b5fdab3a381dec9 100644 (file)
@@ -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
index 49364dac094517db0b906dfc1be93d2dab65fa78..e9799b132e04cd0ef595e021c6bb5001d9ae4125 100644 (file)
@@ -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>
 
index ea3da2cb38356d8de90460f38a4d81829a52737e..15c459abe141044225e8dc12abc283943510fedf 100644 (file)
@@ -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
index fe49453770aa9d774e2a6d265081f9dea923a3fc..dc729709af7f4b5017e782da6bea033b6bf2a997 100644 (file)
@@ -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
index b3c7eb94f946c373e18da2ab4b973d055836424a..e9f5f48fd806f7062abfb696f120d0d323791203 100644 (file)
@@ -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
index 1f163c244d08375a5f9ea0b65e1ac7b0c040cda8..b76651dcc79a5f63d091e2d044c3a9fc44cc2404 100644 (file)
@@ -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.
index edf5fddbad28271f4f211e54a98a05da7fe836f5..540b8adde3b14b428e2dc3740edfd46393c4d7e1 100644 (file)
@@ -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