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

David Blaikie dblaikie at gmail.com
Tue Feb 11 11:15:29 PST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140211/08f886ba/attachment.html>


More information about the cfe-commits mailing list