llvm-project/clang/test/ASTMerge
Andy Gibbs fcc699aee8 Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.
VerifyDiagnosticConsumer previously would not check that the diagnostic and
its matching directive referenced the same source file.  Common practice was
to create directives that referenced other files but only by line number,
and this led to problems such as when the file containing the directive
didn't have enough lines to match the location of the diagnostic in the
other file, leading to bizarre file formatting and other oddities.

This patch causes VerifyDiagnosticConsumer to match source files as well as
line numbers.  Therefore, a new syntax is made available for directives, for
example:

// expected-error@file:line {{diagnostic message}}

This extends the @line feature where "file" is the file where the diagnostic
is generated.  The @line syntax is still available and uses the current file
for the diagnostic.  "file" can be specified either as a relative or absolute
path - although the latter has less usefulness, I think!  The #include search
paths will be used to locate the file and if it is not found an error will be
generated.

The new check is not optional: if the directive is in a different file to the
diagnostic, the file must be specified.  Therefore, a number of test-cases
have been updated with regard to this.

This closes out PR15613.

llvm-svn: 179677
2013-04-17 08:06:46 +00:00
..
Inputs Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then 2012-12-20 02:22:15 +00:00
category.m Fix two thinkos and add a test for importing the AST of a category 2010-12-08 16:41:55 +00:00
class-template.cpp Implement AST import support for class template specializations. 2010-12-01 01:36:18 +00:00
class.cpp Fix code that attempted to produce a diagnostic with one DiagnosticEngine, then 2012-12-20 02:22:15 +00:00
enum.c
exprs.c Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. 2012-10-19 12:44:48 +00:00
function.c Extended VerifyDiagnosticConsumer to also verify source file for diagnostic. 2013-04-17 08:06:46 +00:00
interface.m Improve location fidelity of objc decls. 2011-10-04 04:48:02 +00:00
namespace.cpp
property.m Implement AST import for Objective-C property implementations 2010-12-07 18:32:03 +00:00
struct.c
typedef.c
var.c Flip the default for showing include stacks on notes to false. This 2011-03-27 20:00:08 +00:00