llvm-project/clang/test/Misc
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 Change the include stack of "instantiated from" notes to fall under the control of f/fno-diagnostics-show-note-include-stack flags. This should help with reducing diagnostic spew from macros instantiations. 2011-05-26 20:49:16 +00:00
ast-dump-attr.cpp Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
ast-dump-color.cpp Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
ast-dump-comment.cpp Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
ast-dump-decl.c Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST. 2013-04-13 02:43:54 +00:00
ast-dump-decl.cpp Add triple to another test. 2013-04-15 08:02:05 +00:00
ast-dump-decl.m Implement AST dumper for Decls. 2012-12-20 02:09:13 +00:00
ast-dump-decl.mm Implement AST dumper for Decls. 2012-12-20 02:09:13 +00:00
ast-dump-stmt.c Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
ast-dump-stmt.cpp Fix DeclRefExpr::getFoundDecl() for usages by reference. 2013-03-22 10:01:35 +00:00
ast-dump-stmt.m Implement AST dumper for Decls. 2012-12-20 02:09:13 +00:00
ast-dump-templates.cpp Implement AST dumper for Decls. 2012-12-20 02:09:13 +00:00
ast-dump-wchar.cpp Add indents to AST dumping and removed parenthesis from AST nodes. 2013-01-31 01:44:26 +00:00
caret-diags-macros.c Format strings: don't ever convert %+d to %lu. 2013-01-17 22:34:10 +00:00
caret-diags-scratch-buffer.c
dev-fd-fs.c test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831). 2012-12-18 05:14:30 +00:00
diag-aka-types.cpp Only print a semicolon after "no known conversion for Nth argument" if there 2012-06-28 19:20:41 +00:00
diag-format.c rename -ccc-host-triple into -target 2012-01-20 22:01:23 +00:00
diag-line-wrapping.cpp Diagnostics: if a line is longer than 4096 characters, don't print it. 2013-01-30 21:41:07 +00:00
diag-macro-backtrace.c PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be 2012-12-05 11:04:55 +00:00
diag-mapping.c
diag-mapping2.c
diag-presumed.c Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode for 2012-11-14 23:55:25 +00:00
diag-template-diffing-color.cpp Improve template diffing handling of default integer values. 2013-03-15 23:55:09 +00:00
diag-template-diffing-cxx98.cpp Strip off local qualifiers when converting from RecordType to 2013-03-23 01:38:36 +00:00
diag-template-diffing.cpp Do not assume the template argument is an integer only because the 2013-04-03 02:31:17 +00:00
diag-trailing-null-bytes.cpp Revert r154981, because it caused PR12674. 2012-04-26 21:39:46 +00:00
diag-verify.cpp Modify how the -verify flag works. Currently, the verification string and 2011-12-15 00:38:15 +00:00
diagnostic-crash.cpp Test for LLVM r176911 2013-03-12 23:56:16 +00:00
emit-html-insert.c
emit-html.c Disable _Pragma during HTML macro rewriting to keep from crashing. 2012-06-08 18:06:21 +00:00
error-limit-multiple-notes.cpp Fix -ferror-limit= to properly emit notes following the last error 2011-08-17 19:13:00 +00:00
error-limit.c Fix -ferror-limit= to properly emit notes following the last error 2011-08-17 19:13:00 +00:00
freebsd-arm-size_t.c Initial support for FreeBSD on ARM. 2012-12-13 04:17:14 +00:00
include-stack-for-note-flag.cpp Switch to a more natural formatting of the macro name printing. 2011-10-24 18:51:08 +00:00
integer-literal-printing.cpp StmtPrinter: Write large char values using \u or \U. 2013-02-08 22:30:27 +00:00
macro-backtrace.c Switch to a more natural formatting of the macro name printing. 2011-10-24 18:51:08 +00:00
message-length.c Nicer display of unprintable source, and fix caret display for non-ascii text 2012-04-18 02:44:46 +00:00
predefines.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
remap-file.c
serialized-diags-frontend.c More workarounds for PR10867. 2012-12-05 22:33:14 +00:00
serialized-diags-no-category.c More workarounds for PR10867. 2012-12-05 22:33:14 +00:00
serialized-diags-no-issue.c [serialized diagnostics]: add test cases for serialized diagnostics, including a test case for no issues, multiple issues, and 2011-11-11 00:46:43 +00:00
serialized-diags-single-issue.c Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately 2012-04-12 00:03:31 +00:00
serialized-diags.c More workarounds for PR10867. 2012-12-05 22:33:14 +00:00
serialized-diags.h Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This gives us comparative diagnostics 2011-12-17 05:26:11 +00:00
serialized-diags.m Add regression test for serialized diagnostics for notes without locations. 2013-02-24 07:20:47 +00:00
show-diag-options.c Re-apply r159875 with fixes. 2012-07-07 05:53:30 +00:00
tabstop.c Improve fixit for comparison operator on lhs of bitwise operator. 2012-06-03 07:07:00 +00:00
unnecessary-elipses.cpp only truncate source lines in text diagnostics when 2012-11-03 23:56:43 +00:00
unprintable.c LiteralSupport: Don't overflow the temporary buffer when decoding invalid string parts. 2012-11-08 19:22:31 +00:00
verify.c
warn-in-system-header.c Extended VerifyDiagnosticConsumer to also verify source file for diagnostic. 2013-04-17 08:06:46 +00:00
warn-in-system-header.h Don't hide #warnings in a system header, same as gcc. Fixes rdar://8495837. 2011-04-21 23:08:23 +00:00
warning-flags-enabled.c Make -Wshift-op-parentheses a subgroup of -Wparentheses 2012-10-10 20:30:36 +00:00
warning-flags-tree.c [diagtool] Add a new "tree" command to shows warnings activated by a flag. 2012-06-24 00:07:45 +00:00
warning-flags.c Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. 2013-03-18 22:52:47 +00:00
working-directory.c
wrong-encoding.c add test for r167063 2012-10-31 01:03:35 +00:00
wrong-encoding2.c fix bug in SourceColumnMap::startOfPreviousColumn 2012-11-03 21:21:14 +00:00