public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549
@ 2016-01-20 11:48 Andreas Arnez
  2016-01-20 13:49 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Arnez @ 2016-01-20 11:48 UTC (permalink / raw)
  To: gdb-patches; +Cc: Yao Qi

Version 1:

  https://sourceware.org/ml/gdb-patches/2016-01/msg00437.html

Changes since previous version:

* When verifying the return value, accept any result if the specified
  return value had been ignored before.

* Add comments where `should_kfail' is set and evaluated.


-- 8< ---------------------------------------------------------------
Subject: [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549

The gnu_vector test case yields a new FAIL on s390x:

  FAIL: gdb.base/gnu_vector.exp: verify vector return value

It was introduced by commit 77ae9c1933b50 "gdb.base/gnu_vector.exp:
Don't test output from the inferior".  That commit dropped the special
handling for GDB's inability (on some targets) to set the return value.

This change re-establishes the logic from before, converting the above
FAIL to a KFAIL (PRMS gdb/8549).

gdb/testsuite/ChangeLog:

	* gdb.base/gnu_vector.exp: Re-establish handling for should_kfail
	when GDB can not set the vector return value.  Add more comments
	for clarification.
---
 gdb/testsuite/gdb.base/gnu_vector.exp | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index 6414afd..b934d67 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -230,6 +230,7 @@ gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
 	pass $test
     }
     -re "The location .* is unknown.\r\n.* return value .* will be ignored.\r\n" {
+	# This happens, e.g., on s390x unless using the vector ABI.
 	set should_kfail 1
 	exp_continue
     }
@@ -240,4 +241,18 @@ gdb_test_multiple "return (int4) \{4, 2, 7, 6\}" $test {
 }
 
 gdb_test "next" ""
-gdb_test "p res" "\\{4, 2, 7, 6\\}.*" "verify vector return value"
+set test "verify vector return value"
+gdb_test_multiple "p res" $test {
+    -re ".*= \\{4, 2, 7, 6\\}\r\n.*$gdb_prompt $" {
+	pass $test
+    }
+    -re ".*= \\{.*\\}\r\n.*$gdb_prompt $" {
+	if { $should_kfail } {
+	    # GDB had not actually set the return value, likely due to
+	    # PR8549.  So accept any return value and emit a KFAIL.
+	    kfail "gdb/8549" $test
+	} else {
+	    fail $test
+	}
+    }
+}
-- 
2.3.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549
  2016-01-20 11:48 [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549 Andreas Arnez
@ 2016-01-20 13:49 ` Yao Qi
  2016-01-20 18:44   ` Andreas Arnez
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2016-01-20 13:49 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches, Yao Qi

Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

Hi Andreas,
Patch is OK to me,

> -gdb_test "p res" "\\{4, 2, 7, 6\\}.*" "verify vector return value"
> +set test "verify vector return value"
> +gdb_test_multiple "p res" $test {
> +    -re ".*= \\{4, 2, 7, 6\\}\r\n.*$gdb_prompt $" {
> +	pass $test
> +    }
> +    -re ".*= \\{.*\\}\r\n.*$gdb_prompt $" {
> +	if { $should_kfail } {
> +	    # GDB had not actually set the return value, likely due to
> +	    # PR8549.  So accept any return value and emit a KFAIL.

Nit, we need a space between "PR" and "8549".

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549
  2016-01-20 13:49 ` Yao Qi
@ 2016-01-20 18:44   ` Andreas Arnez
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Arnez @ 2016-01-20 18:44 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches, Yao Qi

On Wed, Jan 20 2016, Yao Qi wrote:

> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
> Hi Andreas,
> Patch is OK to me,
>
>> -gdb_test "p res" "\\{4, 2, 7, 6\\}.*" "verify vector return value"
>> +set test "verify vector return value"
>> +gdb_test_multiple "p res" $test {
>> +    -re ".*= \\{4, 2, 7, 6\\}\r\n.*$gdb_prompt $" {
>> +	pass $test
>> +    }
>> +    -re ".*= \\{.*\\}\r\n.*$gdb_prompt $" {
>> +	if { $should_kfail } {
>> +	    # GDB had not actually set the return value, likely due to
>> +	    # PR8549.  So accept any return value and emit a KFAIL.
>
> Nit, we need a space between "PR" and "8549".

OK, I've committed the patch with that change.  Thanks!

--
Andreas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-20 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20 11:48 [PATCH v2] gnu_vector.exp: Respect `should_kfail' for PR8549 Andreas Arnez
2016-01-20 13:49 ` Yao Qi
2016-01-20 18:44   ` Andreas Arnez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).