Re: [PATCH] Modify dw5-rnglist-test to use .S file instead of .cc file.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Re: [PATCH] Modify dw5-rnglist-test to use .S file instead of .cc file.

Simon Marchi-4
On 2020-07-17 12:23 p.m., Caroline Tice wrote:

> This changes the dw5-rnglist-test.exp to depend on a .S file rather
> than compiling from source.  The reason for this change is that the
> test, in order to test anything meaningful, requires the .cc file to be
> compiled with clang (GCC does not generate the DWARF that this test needs
> to test).
> The .S file in this patch was compiled with clang++  -gdwrarf-5 and
> then edited by
> hand to allow the GNU assembler to process it (all the file indices, in
> both .loc and .file directives, had to be incremented by 1, and the md5 sums
> had to be removed).
> This allows the test to be run with:
>     make check RUNTESTFLAGS="dw5-rnglist-test.exp"
> where before it required:
>     make check RUNTESTFLAGS="CC_FOR_TARGET=/path/to/clang
> CXX_FOR_TARGET=/path/to/clang++ dw5-rnglist-test.exp"
> Is this ok to commit?

Hi Caroline,

I am not very enthusiastic about this approach.  Compared to the .c file
version (the current version), it indeed has the advantage that we
consistently test exactly what we want to test.  However, should we ever
need to tweak the test, to test a slightly different variant, it will
not be possible to modify it / append to it.

The DWARF assembler lets us write test that are much smaller and in a way
that they can evolve.  There's no rush, so I think we should go for the
right solution, that is to improve our DWARF assembler to teach it to
generate .debug_rnglists.dwo sections.