[cfe-commits] [PATCH] Add a new ast-test AST testing mechanism

John Wiegley johnw at boostpro.com
Sat Mar 5 00:23:50 PST 2011


This patch authored by Eric Niebler.

Creates a new executable during the build called 'ast-test', which parses
code and allows expectations to be stated about particular structures within
the AST.  For example:

  // RUN: %ast_test %s

  int i; // expected-decl-type{{int}}

There are many different AST nodes that be directly tested in this way.  At
present, the full list is in tools/ast-test/main.cpp, in the function
ParseDirective, but proper documentation is to be provided in a subsequent
patch.

We rely on this functionality to guarantee that the AST for particular
features meets a certain requirement, as sometimes the lack or presence
of a diagnostic is not suitably indicative.

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-a-new-ast-test-AST-testing-mechanism.patch
Type: text/x-patch
Size: 31789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110305/05aec648/attachment.bin>


More information about the cfe-commits mailing list