Dejagnu profiler problems (was: Committed: Tweak testsuite for MMIX.)
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Sun Oct 27 09:39:00 GMT 2002
> From: Hans-Peter Nilsson <hp@bitrange.com>
>
> On Sun, 27 Oct 2002, Kaveh R. Ghazi wrote:
> > > From: Hans-Peter Nilsson <hp at bitrange dot com>
> > > For some reason the same trivial change *won't* fix:
> > > FAIL: gcc.dg/nest.c (test for excess errors)
> > > Why? Is there a DejaGNU expert in the house?
>
> > > + /* { dg-build "profiler" "No profiler support" { xfail mmix-*-* } } */
>
> > The problem is that dg-build doesn't accept a linenum argument!
>
> Because it's not supposed to look at the line number.
I agree the documentation comments about dg-build in dg.exp can
mislead one to conclude that. However the actual code appears to do
otherwise. In fact, look at these other comments above the definition
of dg-get-options. It says:
# Example: For the following testcase:
#
# /* { dg-prms-id 1234 } */
# int foo { return 0; } /* { dg-build fatal "some comment" } */
#
# we return:
#
# { dg-prms-id 1 1234 } { dg-build 2 fatal "some comment" }
Here it is converting the dg-build C comment into a tcl command which
contains the line number 2.
I've been doing lots of manual experimentation today with dg-build and
it is definitely sensitive to the line number in the source file at
which you place it.
> > So your dg-build command only works if you happen to place it on the
> > line number where the error message appears (and no one editing the
> > testcase ever moves it in the future.) You must have gotten lucky for
> > 20021014-1.c and happened to put it on the right line, but didn't
> > happen to get it on the right line for nest.c. This is annoying and
> > delicate and IMO unworkable.
>
> To avoid such guesses, I should have mentioned that the lines
> don't match. The error happens on line 13 for 20021014-1.c and
> line 9 for nest.c (with the above markers in place). Sorry for
> ruining your theory. Still, it might be a one-digit vs.
> two-digit-problem with the line-numbers...
I'm not sure what you mean by line 13 vs line 9. Are you saying that
the diagnostic output from the compiler invocation emitted 13 and 9
lines respectively for these two test cases? Would you please list
them for me?
> > I'm definitely open to suggestions on this one.
>
> Ditto.
> brgds, H-P
I think I've got one that works for me on solaris2 and irix.
Basically I replaced "dg-build xfail" with "dg-error target 0". Using
dg-error allows me to regexp the whole file by specifying line 0.
I'll post my patch in a separate message. You can examine the
technique to see if it'll work in your mmix case. BTW, whatever you
finally settle on for 20021014-1.c should be backported to the 3.2.x
branch cause that test exists there too.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc-patches
mailing list