diff options
| author | Andy Gibbs <andyg1001@hotmail.co.uk> | 2013-04-17 08:06:46 +0000 |
|---|---|---|
| committer | Andy Gibbs <andyg1001@hotmail.co.uk> | 2013-04-17 08:06:46 +0000 |
| commit | fcc699aee8db46ecbe6d334afde59140dcb7e3af (patch) | |
| tree | 0b87254d1979303eb9e7553da8b202511fc1cc04 /clang/test/Modules/objc-categories.m | |
| parent | dd77743af8623dc77fc9b90548b4343a7259f420 (diff) | |
| download | bcm5719-llvm-fcc699aee8db46ecbe6d334afde59140dcb7e3af.tar.gz bcm5719-llvm-fcc699aee8db46ecbe6d334afde59140dcb7e3af.zip | |
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
Diffstat (limited to 'clang/test/Modules/objc-categories.m')
| -rw-r--r-- | clang/test/Modules/objc-categories.m | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/test/Modules/objc-categories.m b/clang/test/Modules/objc-categories.m index d3ebcb75279..81fb28bafb2 100644 --- a/clang/test/Modules/objc-categories.m +++ b/clang/test/Modules/objc-categories.m @@ -8,11 +8,8 @@ @import category_bottom; - - - -// in category_left.h: expected-note {{previous definition}} -// in category_right.h: expected-warning@11 {{duplicate definition of category}} +// expected-note@Inputs/category_left.h:14 {{previous definition}} +// expected-warning@Inputs/category_right.h:11 {{duplicate definition of category}} @interface Foo(Source) -(void)source; @@ -75,7 +72,7 @@ void test_hidden_right_errors(Foo *foo) { [p4 p4_method]; // expected-warning{{instance method '-p4_method' not found (return type defaults to 'id')}} id p4p = p4.p4_prop; // expected-error{{property 'p4_prop' not found on object of type 'id<P4>'}} p4p = foo.p4_prop; // expected-error{{property 'p4_prop' not found on object of type 'Foo *'; did you mean 'p3_prop'?}} - // expected-note@7{{'p3_prop' declared here}} + // expected-note@Inputs/category_left_sub.h:7{{'p3_prop' declared here}} } @import category_right.sub; |

