[PATCH] PPCallbacksTest expansion - part 1

Sean Silva silvas at purdue.edu
Sat Nov 16 23:55:42 PST 2013


On Sat, Nov 16, 2013 at 3:51 AM, Kim Gräsman <kim.grasman at gmail.com> wrote:

> Sean, John,
>
> On Fri, Oct 18, 2013 at 2:12 AM, Sean Silva <silvas at purdue.edu> wrote:
> >
> >   Turning the preprocessor decisions into a serialized textual format is
> a great idea!
> >
> >   Though this seems like it would be better done as an independent tool.
> I.e. one that reads its file on stdin (or as an argument) and prints out
> this information, for use in conjunction with FileCheck. That would allow
> idiomatic LLVM FileCheck testing similar to:
> >
> >       ; RUN: opt < %s -sroa -S | FileCheck %s
> >
> >   (that was from `llvm/test/Transforms/SROA/basictest.ll` but there are
> innumerable other examples).
> >
> >   so the usage would be something like:
> >
> >       ; RUN: pp-trace < %s | FileCheck %s
> >
> >   That would also completely offload the burden of the pattern
> matching/specification to FileCheck, and integrate with developers'
> existing familiarity with FileCheck.
>
> I've already used pp-trace to great effect for learning more about
> PPCallbacks sequences when parsing code.
>

Credit is all John's for the great idea! In general, observability into
what is happening is always highly enlightening.

>
> It'll be difficult to use pp-trace for these tests, though, as it's in
> clang-tools-extra. Was there a plan to get it into clang/tools?
>

If it would be useful for writing test in clang/, then I think it makes
sense to move it. Why don't you try emailing cfe-dev with some example
tests you would like to add?

-- Sean Silva


>
> - Kim
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131117/02a470ed/attachment.html>


More information about the cfe-commits mailing list