[cfe-commits] r149127 - in /cfe/trunk: include/clang/AST/ include/clang/Parse/ include/clang/Sema/ lib/AST/ lib/Parse/ lib/Sema/ lib/Serialization/ tools/libclang/

Enea Zaffanella zaffanella at cs.unipr.it
Sat Jan 28 00:56:41 PST 2012

On 01/28/2012 08:41 AM, Richard Smith wrote:
> On Fri, Jan 27, 2012 at 11:31 PM, Enea Zaffanella
> <zaffanella at cs.unipr.it <mailto:zaffanella at cs.unipr.it>> wrote:
>     On 01/27/2012 08:39 PM, Richard Smith wrote:
>         Is there some way you can add tests for this?
>         On Fri, Jan 27, 2012 at 1:46 AM, Abramo Bagnara
>         <abramo.bagnara at gmail.com <mailto:abramo.bagnara at gmail.com>
>         <mailto:abramo.bagnara at gmail.__com
>         <mailto:abramo.bagnara at gmail.com>>> wrote:
>             Author: abramo
>             Date: Fri Jan 27 03:46:47 2012
>             New Revision: 149127
>             URL:
>         http://llvm.org/viewvc/llvm-__project?rev=149127&view=rev
>         <http://llvm.org/viewvc/llvm-project?rev=149127&view=rev>
>         <http://llvm.org/viewvc/llvm-__project?rev=149127&view=rev
>         <http://llvm.org/viewvc/llvm-project?rev=149127&view=rev>>
>             Log:
>             Added source location for the template keyword in AST
>         template-id
>             expressions.
>     Short answer: no way that we are aware of.
>     Longer answer:
>     the changes in both r149124 and r149127 are improving upon the
>     "syntactic aspects" of the AST representation. Their effect can be
>     observed by inspecting the output produced by -ast-print; see, for
>     instance, the example code in
>     http://lists.cs.uiuc.edu/__pipermail/cfe-dev/2012-__January/019564.html
>     <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-January/019564.html>
>     As far as we know, the output of -ast-print is just a convenience
>     (probably, to simplify visual debugging of the AST). Nonetheless,
>     the added info is important for some source-code based applications.
> These tests would not be the first in the test-suite to run FileCheck
> over the output of -ast-print. That kind of test (while not ideal) seems
> much better than making large changes with no test coverage. That
> obviously won't check whether the source location is correct, but it
> will check whether it's valid in the right set of circumstances.
> - Richard

Thanks for providing us info on what to search for.
(In my previous, shallow inspection of the test suite I found tests such 
as tests/Parser/char-literal-printing.c or tests/Sema/ast-print.c, which 
are not using FileCheck at all.)

We will now commit an adaptation of the test we have been playing with 
while developing the patch.


More information about the cfe-commits mailing list