Re: [_Complex test 2/4] _Complex type in varargs.exp

Pedro Alves
2011-05-23T10:27:36Z

On Monday 23 May 2011 05:08:58, Yao Qi wrote:
> On 05/20/2011 11:37 PM, Pedro Alves wrote:
> > Did you try setup_kfail? See below. The way you have things
> > doesn't catch the internal error case because that is matched
> > within gdb_test_multiple itself. You could also check the return
> > of gdb_test_multiple to see if an internal match happened, but
> > that's more complicated than setup_kfail.
> >
>
> I see. It has been mentioned in the comment to proc gdb_test_multiple
>
> # Returns:
> # 1 if the test failed, according to a built-in failure pattern
> # 0 if only user-supplied patterns matched
> # -1 if there was an internal error.
>
> Thanks.
>
> >> > x86_64-unknown-linux-gnu:
> >> > KFAIL: gdb.base/varargs.exp: print find_max_float_real(4, fc1, fc2, fc3,
> >> > fc4) (PRMS: gdb/12790)
> >> > KFAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2,
> >> > dc3, dc4) (PRMS: gdb/12790)
> >> > FAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
> >> > ldc2, ldc3, ldc4) (GDB internal error)
> >> >
> > setup_kfail gdb/12776 "i?86-*-*"
> > setup_kfail gdb/12790 "x86_64-*-*"
> > setup_kfail gdb/12791 "arm*-*-*"
> > set test "print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)"
> > gdb_test_multiple $test $test {
> > -re ".*= 4 \\+ 4 \\* I.*${gdb_prompt} $" {
> > pass $test
> > }
> > }
>
> This is exactly what I did when I was writing this patch. However, the
> wrong PR number is got in KFAIL result, like this,
>
> KFAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
> ldc2, ldc3, ldc4) (PRMS: gdb/12791)
>
> I was running test case on i686-pc-linux-gnu, but the PR number
> displayed was arm's PR. Source code of proc setup_kfail shows that PR
> number is saved in kfail_prms unconditionally. Of course, only the PR
> in last call of setup_kfail is saved. This is a limitation of
> setup_kfail, IMO.

Huh, indeed.

> I gave up on this direction then.
>
> In order to overcome this limitation, a new proc setup_kfail_for_target
> is added in lib/gdb.exp, which only call setup_kfail if istarget returns
> true.

Okay.

>
> > Maybe you can even convert the gdb_test_multiple's to gdb_test that way.
> > (You could also put the setup_kfails in a procedure to not need to
> > repeat them everywhere).
>
> Since we are using setup_kfail, we can surely convert gdb_test_multiple
> to gdb_test. I don't put setup_kfails in a proc, because, KFAILs on x86
> are different from KFAILs on arm/x86_64.
>
> In my new patch, the internal-error on x86_64 is KFAIL'ed.
>
> KFAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1,
> ldc2, ldc3, ldc4) (GDB internal error) (PRMS: gdb/12790)

Looks good to me.

--
Pedro Alves