* [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 @ 2016-01-19 16:33 Andreas Arnez 2016-01-19 17:33 ` Yao Qi 0 siblings, 1 reply; 4+ messages in thread From: Andreas Arnez @ 2016-01-19 16:33 UTC (permalink / raw) To: gdb-patches; +Cc: Yao Qi 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. --- gdb/testsuite/gdb.base/gnu_vector.exp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp index 6414afd..127c0b7 100644 --- a/gdb/testsuite/gdb.base/gnu_vector.exp +++ b/gdb/testsuite/gdb.base/gnu_vector.exp @@ -240,4 +240,16 @@ 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 ".*= \\{10, 20, 48, 72\\}\r\n.*$gdb_prompt $" { + if { $should_kfail } { + kfail "gdb/8549" $test + } else { + fail $test + } + } +} -- 2.5.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 2016-01-19 16:33 [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 Andreas Arnez @ 2016-01-19 17:33 ` Yao Qi 2016-01-19 18:46 ` Andreas Arnez 0 siblings, 1 reply; 4+ messages in thread From: Yao Qi @ 2016-01-19 17:33 UTC (permalink / raw) To: Andreas Arnez; +Cc: gdb-patches, Yao Qi 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. -- Yao (齐尧) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 2016-01-19 17:33 ` Yao Qi @ 2016-01-19 18:46 ` Andreas Arnez 2016-01-20 9:32 ` Yao Qi 0 siblings, 1 reply; 4+ messages in thread From: Andreas Arnez @ 2016-01-19 18:46 UTC (permalink / raw) To: Yao Qi; +Cc: gdb-patches 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? 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 { ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 2016-01-19 18:46 ` Andreas Arnez @ 2016-01-20 9:32 ` Yao Qi 0 siblings, 0 replies; 4+ messages in thread From: Yao Qi @ 2016-01-20 9:32 UTC (permalink / raw) To: Andreas Arnez; +Cc: Yao Qi, gdb-patches 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. -- Yao (齐尧) ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-20 9:32 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-01-19 16:33 [PATCH] gnu_vector.exp: Respect `should_kfail' for PR8549 Andreas Arnez 2016-01-19 17:33 ` Yao Qi 2016-01-19 18:46 ` Andreas Arnez 2016-01-20 9:32 ` Yao Qi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox