hanchenye-llvm-project/clang/test/Frontend
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 rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency. 2013-04-16 19:08:41 +00:00
Weverything.c
Wno-everything.c
ast-codegen.c A number of test cases assume that an "int" parameter or return value 2012-10-24 12:22:56 +00:00
ast-main.c
ast-main.cpp Delayed template parsing is not supported by the AST serialization system yet, so turning it off. This fixes a test breakage caused by r177336. 2013-03-21 19:38:59 +00:00
cpp-output.c
darwin-version.c
dependency-gen-escaping.c Escape # and $ in dependency files. 2013-04-02 13:38:48 +00:00
dependency-gen.c
dependency-generation-crash.c
diagnostics-option-names.c
hexagon-target-basic.c hexagon-target-basic.c test: add REQUIRES line for hexagon target 2013-01-02 22:30:14 +00:00
iframework.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
ir-support-codegen.ll
ir-support-errors.ll
lit.local.cfg
macros.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
output-failures.c
preprocessed-output-macro-first-token.c
print-header-includes.c
rewrite-includes-invalid-hasinclude.c rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency. 2013-04-16 19:08:41 +00:00
rewrite-includes-missing.c [frontend] -frewrite-includes: if there was no inclusion, don't add lineinfo that indicates return from another file. 2013-04-10 01:53:37 +00:00
rewrite-includes-modules.c [frontend] -frewrite-includes: turn implicit module imports into @imports. 2013-04-10 01:53:50 +00:00
rewrite-includes.c rewrite-includes: Rewrite __has_include(_next) to get rid of a host dependency. 2013-04-16 19:08:41 +00:00
rewrite-macros.c Follow Jordan's advice and use {{^}} and {{$}} for this test 2013-04-11 18:39:10 +00:00
stdin.c
system-header-prefix.c
undef.c
unknown-pragmas.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
verify-directive.h
verify-fatal.c
verify.c Extended VerifyDiagnosticConsumer to also verify source file for diagnostic. 2013-04-17 08:06:46 +00:00
verify2.c Change VerifyDiagnosticConsumer so that it *must* contain at least one "expected-*" directive. As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases. This new directive may not be used in conjunction with any other "expected-*" directive. 2012-10-19 12:49:32 +00:00
verify2.h
verify3.c Change VerifyDiagnosticConsumer so that it *must* contain at least one "expected-*" directive. As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases. This new directive may not be used in conjunction with any other "expected-*" directive. 2012-10-19 12:49:32 +00:00
warning-mapping-1.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
warning-mapping-2.c
warning-mapping-3.c
warning-mapping-4.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
warning-mapping-5.c
warning-options.cpp [driver] Warnings for warning options are handled by the frontend. The driver needs to process the 2013-01-15 01:21:53 +00:00