[cfe-dev] clang target tests

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Fri Sep 7 10:36:33 PDT 2018


On Fri, Sep 7, 2018 at 10:29 AM Tim Northover via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi David,
>
> On Fri, 7 Sep 2018 at 15:53, David Greene via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
> > Unfortunately, I can't have the test emit LLVM IR because that won't
> > contain what I need to test.  I can't make it an LLVM test because I'm
> > testing the interaction of options to clang.
>
> There ought to be *some* trace, either in the cc1 options (in which
> case you'd write a Driver test and an LLVM one), or in the IR.


There are some small gaps - where the interaction between Clang and LLVM is
purely done via API, rather than command line or IR. For example things
like MCOptions, TargetOptions, etc - if you change Clang to compute the
parameters to those options differently (or regressed that functionality by
not initializing those options correctly, etc) pure clang (command line +
source => IR) or LLVM (IR => assembly), etc, couldn't catch it. In many
cases those options can be moved to the IR, but some don't make sense/need
to be there.


> That
> said, I won't second guess you...
>

I will a little bit - it'd be good to see the thing being tested just to
understand if it is one of those gaps.


> > How does cmake/lit decide whether tests in test/CodeGen should be run or
> > not?  Take test/CodeGen/x86.c.  It's looking for register name specific
> > to an x86 target.  How does the testing infrastructure know not to run
> > this test if clang is built without support for x86?
>
> That particular test doesn't need a backend because it only checks
> LLVM IR. But what you're looking for is "REQUIRES:
> x86-registered-target" (or similar if you're not testing x86).
>
> Cheers.
>
> Tim.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180907/0524fab5/attachment.html>


More information about the cfe-dev mailing list