aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorFrederik Harwath <frederik@codesourcery.com>2020-06-29 08:42:56 +0200
committerFrederik Harwath <frederik@codesourcery.com>2020-06-29 08:42:57 +0200
commitd4501bbedca267f2051e4f57415d6d2a61306915 (patch)
tree1ad4085eff9f450c2917a2b940a42b5060eb76a4 /gcc/doc
parent69273534c658949129ac6c389ea25c9cddec3767 (diff)
downloadgcc-d4501bbedca267f2051e4f57415d6d2a61306915.zip
gcc-d4501bbedca267f2051e4f57415d6d2a61306915.tar.gz
gcc-d4501bbedca267f2051e4f57415d6d2a61306915.tar.bz2
testsuite: clarify scan-dump file globbing behavior
The test commands for scanning optimization dump files perform globbing on the argument that specifies the suffix of the dump files to be scanned. This behavior is currently undocumented. Furthermore, the current implementation of "scan-dump" and similar procedures yields an error whenever the file name globbing matches more than one file (due to an attempt to call "open" on multiple files) while a failure to match any file results in an unresolved test. This commit documents the globbing behavior. The dump scanning procedures are changed to make the test unresolved if globbing matches more than one file. gcc/ChangeLog: 2020-06-29 Frederik Harwath <frederik@codesourcery.com> * doc/sourcebuild.texi: Describe globbing of the dump file scanning commands "suffix" argument. gcc/testsuite/ChangeLog: 2020-06-29 Frederik Harwath <frederik@codesourcery.com> * lib/scandump.exp (glob-dump-file): New proc. (scan-dump): Use glob-dump-file for file name expansion. (scan-dump-times): Likewise. (scan-dump-dem): Likewise. (scan-dump-dem-not): Likewise. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/sourcebuild.texi13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index a12af82..5b5b845 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2943,6 +2943,19 @@ Passes if @var{regex} does not match demangled text in the dump file with
suffix @var{suffix}.
@end table
+The @var{suffix} argument which describes the dump file to be scanned
+may contain a glob pattern that must expand to exactly one file
+name. This is useful if, e.g., different pass instances are executed
+depending on torture testing command-line flags, producing dump files
+whose names differ only in their pass instance number suffix. For
+example, to scan instances 1, 2, 3 of a tree pass ``mypass'' for
+occurrences of the string ``code has been optimized'', use:
+@smallexample
+/* @{ dg-options "-fdump-tree-mypass" @} */
+/* @{ dg-final @{ scan-tree-dump "code has been optimized" "mypass\[1-3\]" @} @} */
+@end smallexample
+
+
@subsubsection Check for output files
@table @code