[PATCH] Pass -gdwarf-N options to integrated assembler

Oliver Stannard oliver.stannard at arm.com
Wed Feb 12 02:43:54 PST 2014


I'm not sure how to test this, since it is in the cc1as driver. I have had a
look, and cannot find any existing tests that run cc1as.

In a related patch, http://llvm-reviews.chandlerc.com/D2697, I have added
the same command-line options to llvm-mc, and those options and the emitted
dwarf is tested there.

Oliver

-----Original Message-----
From: Renato Golin [mailto:renato.golin at linaro.org] 
Sent: 12 February 2014 10:19
To: Oliver Stannard
Subject: Fwd: [PATCH] Pass -gdwarf-N options to integrated assembler

FYI, this didn't get into phab and was not copied to you directly.

Can you add the tests David is asking for? If you don't know how (I
don't), please ask David.

cheers,
--renato


---------- Forwarded message ----------
From: David Blaikie <dblaikie at gmail.com>
Date: 11 February 2014 19:15
Subject: Re: [PATCH] Pass -gdwarf-N options to integrated assembler
To: Renato Golin <renato.golin at linaro.org>
Cc: reviews+D2737+public+b93055d88c52684c at llvm-reviews.chandlerc.com,
llvm cfe <cfe-commits at cs.uiuc.edu>





On Tue, Feb 11, 2014 at 11:08 AM, Renato Golin <renato.golin at linaro.org>
wrote:
>
> On 11 February 2014 17:15, David Blaikie <dblaikie at gmail.com> wrote:
> > This code appears to be untested - is that the case? Can we test it in
some
> > way? (it might necessarily be an IR level test, but just testing that
the
> > version in the generated DWARF is what was requested - I think that'd be
> > OK... but open to debate/discussion on the matter)
>
> Hi David,
>
> The Dwarf version gets passed down there...
>
> >> +  Ctx.setDwarfVersion(Opts.DwarfVersion);
>
> Assuming the setDwarfVersion works correctly, this feature will also
> work correctly.
>
> I may be missing something, but IIRC it's not recommended to test what
> gets passed down to the MC layer on Clang tests.


Generally we don't want to test MC functionality in Clang, no (so
don't test that the flag does a certain thing - I wouldn't suggest
testing that -gdwarf-2 causes us to avoid emitting certain kinds of
DWARF, for example) - but just testing some basic level of "we used
the API correctly" would be nice.

Since we don't do API level testing, generally, (nor have any way to
stub out MC to test that cc1as, when passed -gdwarf-2 calls
"setDwarfVersion(2)") this if/else block is either untested, or is
tested along with some amount of LLVM's behavior too.

(there are cases where we do such testing - all our IR testing
indirectly "tests" IRBuilder (or DIBuilder as well, in the case of
debug tests) because testing on the actual API boundary requires
stubbing, etc, which we don't do)

>
> Are you suggesting we add tests to MC, too? That'd be good, I think,
> but for another patch.


We basically test MC with LLVM CodeGen tests already, so I wasn't
suggesting that. (arguably it'd still potentially be useful to test
that "setDwarfVersion" works (when it's not pased in through IR like
the CodeGen tests) - presumably llvm-mc should have a command line
support for this property and we'd test it that way)

- David








More information about the cfe-commits mailing list