blob: 71c983b883853c8d95eae57bf5c4cc9aa80efc84 [file] [log] [blame]
Ted Kremenek026cd1a2013-02-24 07:20:47 +00001@interface Foo
2- (void) test;
3- (void) test2;
4@end
5
6@implementation Foo
7- (void) test {
8 [_self test2];
9}
10- (void) test2 {}
11@end
12
13// RUN: rm -f %t
14// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&1
15// RUN: c-index-test -read-diagnostics %t.diag > %t 2>&1
16// RUN: FileCheck --input-file=%t %s
17
18// This test checks that serialized diagnostics handle notes with no source location.
19
20// CHECK: {{.*[/\\]}}serialized-diags.m:8:4: error: use of undeclared identifier '_self'; did you mean 'self'? [] [Semantic Issue]
21// CHECK: Range: {{.*[/\\]}}serialized-diags.m:8:4 {{.*[/\\]}}serialized-diags.m:8:9
22// CHECK: Number FIXITs = 1
23// CHECK: FIXIT: ({{.*[/\\]}}serialized-diags.m:8:4 - {{.*[/\\]}}serialized-diags.m:8:9): "self"
Stephen Hines176edba2014-12-01 14:53:08 -080024// CHECK: +-(null):0:0: note: 'self' is an implicit parameter [] [Semantic Issue]
Ted Kremenek026cd1a2013-02-24 07:20:47 +000025// CHECK: Number FIXITs = 0
26// CHECK: {{.*[/\\]}}serialized-diags.m:1:12: warning: class 'Foo' defined without specifying a base class [-Wobjc-root-class] [Semantic Issue]
27// CHECK: Number FIXITs = 0
28// CHECK: +-{{.*[/\\]}}serialized-diags.m:1:15: note: add a super class to fix this problem [] [Semantic Issue]
29// CHECK: Number FIXITs = 0
30// CHECK: Number of diagnostics: 2