diff options
author | David Malcolm <dmalcolm@redhat.com> | 2018-10-05 17:35:55 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2018-10-05 17:35:55 +0000 |
commit | 9a85d982cc52c200ac8530c05909df593a0d075c (patch) | |
tree | 0cac802aa39f6f88713d4e2b167146d0f5dacf24 | |
parent | 08993ffb5277066fcdb082fdb9a03bdbabd766a6 (diff) | |
download | gcc-9a85d982cc52c200ac8530c05909df593a0d075c.zip gcc-9a85d982cc52c200ac8530c05909df593a0d075c.tar.gz gcc-9a85d982cc52c200ac8530c05909df593a0d075c.tar.bz2 |
testsuite: multiline.exp: implement optional target/xfail selector
gcc/testsuite/ChangeLog:
* lib/multiline.exp (proc dg-end-multiline-output): Check argument
count. If there's a 3rd argument, use dg-process-target on it,
bailing out, or recording expected failures as "maybe_x".
(proc handle-multiline-outputs): Extract "maybe_x", and use it
to convert pass/fail into xpass/xfail.
From-SVN: r264880
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/lib/multiline.exp | 30 |
2 files changed, 33 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9079061..2f3abab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2018-10-05 David Malcolm <dmalcolm@redhat.com> + + * lib/multiline.exp (proc dg-end-multiline-output): Check argument + count. If there's a 3rd argument, use dg-process-target on it, + bailing out, or recording expected failures as "maybe_x". + (proc handle-multiline-outputs): Extract "maybe_x", and use it + to convert pass/fail into xpass/xfail. + 2018-10-05 Martin Sebor <msebor@redhat.com> PR tree-optimization/87490 diff --git a/gcc/testsuite/lib/multiline.exp b/gcc/testsuite/lib/multiline.exp index 5f8b62f..6c7ecdf 100644 --- a/gcc/testsuite/lib/multiline.exp +++ b/gcc/testsuite/lib/multiline.exp @@ -78,6 +78,8 @@ proc dg-begin-multiline-output { args } { # Mark the end of an expected multiline output # All lines up to here since the last dg-begin-multiline-output are # expected to be seen. +# +# dg-end-multiline-output comment [{ target/xfail selector }] proc dg-end-multiline-output { args } { global _multiline_last_beginning_line @@ -85,6 +87,23 @@ proc dg-end-multiline-output { args } { set line [expr [lindex $args 0] - 1] verbose "multiline output lines: $_multiline_last_beginning_line-$line" 3 + if { [llength $args] > 3 } { + error "[lindex $args 0]: too many arguments" + return + } + + set maybe_x "" + if { [llength $args] >= 3 } { + switch [dg-process-target [lindex $args 2]] { + "F" { set maybe_x "x" } + "P" { set maybe_x "" } + "N" { + # If we get "N", this output doesn't apply to us so ignore it. + return + } + } + } + upvar 1 prog prog verbose "prog: $prog" 3 # "prog" now contains the filename @@ -93,8 +112,8 @@ proc dg-end-multiline-output { args } { set lines [_get_lines $prog $_multiline_last_beginning_line $line] verbose "lines: $lines" 3 - # Create an entry of the form: first-line, last-line, lines - set entry [list $_multiline_last_beginning_line $line $lines] + # Create an entry of the form: first-line, last-line, lines, maybe_x + set entry [list $_multiline_last_beginning_line $line $lines $maybe_x] global multiline_expected_outputs lappend multiline_expected_outputs $entry verbose "within dg-end-multiline-output: multiline_expected_outputs: $multiline_expected_outputs" 3 @@ -118,6 +137,7 @@ proc handle-multiline-outputs { text } { set start_line [lindex $entry 0] set end_line [lindex $entry 1] set multiline [lindex $entry 2] + set maybe_x [lindex $entry 3] verbose " multiline: $multiline" 3 set rexp [_build_multiline_regex $multiline $index] verbose "rexp: ${rexp}" 4 @@ -130,10 +150,10 @@ proc handle-multiline-outputs { text } { # Use "regsub" to attempt to prune the pattern from $text if {[regsub -line $rexp $text "" text]} { - # Success; the multiline pattern was pruned. - pass "$title was found: \"$escaped_regex\"" + # The multiline pattern was pruned. + ${maybe_x}pass "$title was found: \"$escaped_regex\"" } else { - fail "$title not found: \"$escaped_regex\"" + ${maybe_x}fail "$title not found: \"$escaped_regex\"" } set index [expr $index + 1] |