gnu_vector.exp: Respect `should_kfail' for PR8549

Message ID m3d1sxs8zo.fsf@oc1027705133.ibm.com
State New, archived
Headers

Commit Message

Andreas Arnez Jan. 19, 2016, 6:46 p.m. UTC
  On Tue, Jan 19 2016, Yao Qi wrote:

> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
>> -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 ".*= \\{10, 20, 48, 72\\}\r\n.*$gdb_prompt $" {
>> +	if { $should_kfail } {
>> +	    kfail "gdb/8549" $test
>> +	} else {
>> +	    fail $test
>> +	}
>> +    }
>> +}
>
> IMO, if GDB for a certain target doesn't handle "return" and "finish"
> correctly, the return value can be some random results.  Why do we match
> "\\{10, 20, 48, 72\\}" here?  I presume that because "10, 20, 48, 72"
> was returned in the previous test.  Do *all* targets don't correctly handle
> "return" and "finish" return "\\{10, 20, 48, 72\\}"?  In other words, if
> we know it is broken already, why do still match the output?  We can
> kfail it according to the target triplet.

Doing the KFAIL based on the target triplet would miss the point of this
test on s390x, because on the same target "s390x-ibm-linux-gnu" the test
shall succeed if the CPU has vector registers and the vector ABI is
used, but is known to fail if a non-vector ABI is used.  (Note that the
main reason for enhancing the gnu_vector test case was to verify GDB's
correct treatment of the s390x vector ABI.)

But testing against some expected return value in this case is certainly
wrong.  I suggest to change my patch like follows.  WDYT?
  

Comments

Yao Qi Jan. 20, 2016, 9:31 a.m. UTC | #1
Andreas Arnez <arnez@linux.vnet.ibm.com> writes:

> Doing the KFAIL based on the target triplet would miss the point of this
> test on s390x, because on the same target "s390x-ibm-linux-gnu" the test
> shall succeed if the CPU has vector registers and the vector ABI is
> used, but is known to fail if a non-vector ABI is used.  (Note that the
> main reason for enhancing the gnu_vector test case was to verify GDB's
> correct treatment of the s390x vector ABI.)

Could you add some comments in the test case about what you said above?

>
> But testing against some expected return value in this case is certainly
> wrong.  I suggest to change my patch like follows.  WDYT?

That is fine with me.
  

Patch

diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index 127c0b7..c911830 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -245,7 +245,7 @@  gdb_test_multiple "p res" $test {
     -re ".*= \\{4, 2, 7, 6\\}\r\n.*$gdb_prompt $" {
 	pass $test
     }
-    -re ".*= \\{10, 20, 48, 72\\}\r\n.*$gdb_prompt $" {
+    -re ".*= \\{.*\\}\r\n.*$gdb_prompt $" {
 	if { $should_kfail } {
 	    kfail "gdb/8549" $test
 	} else {