aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-02-24 07:20:47 +0000
committerTed Kremenek <kremenek@apple.com>2013-02-24 07:20:47 +0000
commit026cd1a273d16eaa9a66be92f38b1f907202e542 (patch)
tree7953dfd1106f379cad923d6a6511b8e6212af970
parent5956bcc31ad0b1f570e04f7e19e817112f7274c5 (diff)
Add regression test for serialized diagnostics for notes without locations.
This meant to be included in r175802. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175986 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Misc/serialized-diags.m30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Misc/serialized-diags.m b/test/Misc/serialized-diags.m
new file mode 100644
index 0000000000..aac791e9e2
--- /dev/null
+++ b/test/Misc/serialized-diags.m
@@ -0,0 +1,30 @@
+@interface Foo
+- (void) test;
+- (void) test2;
+@end
+
+@implementation Foo
+- (void) test {
+ [_self test2];
+}
+- (void) test2 {}
+@end
+
+// RUN: rm -f %t
+// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.diag > /dev/null 2>&1
+// RUN: c-index-test -read-diagnostics %t.diag > %t 2>&1
+// RUN: FileCheck --input-file=%t %s
+
+// This test checks that serialized diagnostics handle notes with no source location.
+
+// CHECK: {{.*[/\\]}}serialized-diags.m:8:4: error: use of undeclared identifier '_self'; did you mean 'self'? [] [Semantic Issue]
+// CHECK: Range: {{.*[/\\]}}serialized-diags.m:8:4 {{.*[/\\]}}serialized-diags.m:8:9
+// CHECK: Number FIXITs = 1
+// CHECK: FIXIT: ({{.*[/\\]}}serialized-diags.m:8:4 - {{.*[/\\]}}serialized-diags.m:8:9): "self"
+// CHECK: +-(null):0:0: note: 'self' is an implicit parameter [] []
+// CHECK: Number FIXITs = 0
+// CHECK: {{.*[/\\]}}serialized-diags.m:1:12: warning: class 'Foo' defined without specifying a base class [-Wobjc-root-class] [Semantic Issue]
+// CHECK: Number FIXITs = 0
+// CHECK: +-{{.*[/\\]}}serialized-diags.m:1:15: note: add a super class to fix this problem [] [Semantic Issue]
+// CHECK: Number FIXITs = 0
+// CHECK: Number of diagnostics: 2