r175986 - Add regression test for serialized diagnostics for notes without locations.

Ted Kremenek kremenek at apple.com
Sat Feb 23 23:20:47 PST 2013


Author: kremenek
Date: Sun Feb 24 01:20:47 2013
New Revision: 175986

URL: http://llvm.org/viewvc/llvm-project?rev=175986&view=rev
Log:
Add regression test for serialized diagnostics for notes without locations.

This meant to be included in r175802.

Added:
    cfe/trunk/test/Misc/serialized-diags.m

Added: cfe/trunk/test/Misc/serialized-diags.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/serialized-diags.m?rev=175986&view=auto
==============================================================================
--- cfe/trunk/test/Misc/serialized-diags.m (added)
+++ cfe/trunk/test/Misc/serialized-diags.m Sun Feb 24 01:20:47 2013
@@ -0,0 +1,30 @@
+ at interface Foo
+- (void) test;
+- (void) test2;
+ at end
+
+ at implementation Foo
+- (void) test {
+  [_self test2];
+}
+- (void) test2 {}
+ at 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





More information about the cfe-commits mailing list