[PATCH] -verify enhancement to support matching "any" line in included files

Andy Gibbs andyg1001 at hotmail.co.uk
Thu Jul 3 06:32:05 PDT 2014


Hi,

I have made an enhancement to the -verify function of clang to support 
matching diagnostics in included header files where the line number is not 
necessarily known (or constant).

Currently, matching a diagnostic in an included file is done as in the 
following fragment:

  // expected-warning at +2 {{incompatible}} expected-warning at +2 {{literal}}
  // expected-note at stdio.h:359 {{here}}
  printf(12);

Problem is, the line number inside stdio.h is dependent on the system, so 
the attached patch provides support for substituting the line number for 
'*', as in:

  // expected-note at stdio.h:* {{here}}

so that the diagnostic is matched without the line number being known.

I've intentially limited this feature to line numbers in external files only 
since the line numbers in the main source file should be always "known". 
While this change may not have an immediate and particular purpose for the 
clang test-suite itself, I personally feel it is a good and useful 
enhancement to -verify for people (like me!) who use this for testing 
3rd-party library code.

Please let me know if this has support/approval for being committed...

Thanks

Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify.patch
Type: application/octet-stream
Size: 7783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140703/432c93b3/attachment.obj>


More information about the cfe-commits mailing list