summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-09 20:57:01 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-09 20:57:01 +0000
commit791c08734aa802dcf454b67a97eba9c43dbda088 (patch)
tree3a7ea4d1fc53a736959e1e663ea91e0a654dce3b
parent90eab67320745dcacd6ed07a16933a68d1b59c54 (diff)
downloadbcm5719-llvm-791c08734aa802dcf454b67a97eba9c43dbda088.tar.gz
bcm5719-llvm-791c08734aa802dcf454b67a97eba9c43dbda088.zip
Improve Objective-C token-annotation test
llvm-svn: 98078
-rw-r--r--clang/test/Index/annotate-tokens.m29
1 files changed, 28 insertions, 1 deletions
diff --git a/clang/test/Index/annotate-tokens.m b/clang/test/Index/annotate-tokens.m
index c42e6a51844..1badeb20be7 100644
--- a/clang/test/Index/annotate-tokens.m
+++ b/clang/test/Index/annotate-tokens.m
@@ -2,7 +2,13 @@
- (int)compare:(Foo*)other;
@end
-// RUN: c-index-test -test-annotate-tokens=%s:1:1:3:5 %s | FileCheck %s
+@implementation Foo
+- (int)compare:(Foo*)other {
+ return 0;
+}
+@end
+
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:9:5 %s | FileCheck %s
// CHECK: Punctuation: "@" [1:1 - 1:2]
// CHECK: Identifier: "interface" [1:2 - 1:11]
// CHECK: Identifier: "Foo" [1:12 - 1:15] ObjCInterfaceDecl=Foo:1:12
@@ -20,3 +26,24 @@
// CHECK: Punctuation: ";" [2:27 - 2:28]
// CHECK: Punctuation: "@" [3:1 - 3:2]
// CHECK: Identifier: "end" [3:2 - 3:5]
+// CHECK: Punctuation: "@" [5:1 - 5:2] ObjCImplementationDecl=Foo:5:1 (Definition)
+// CHECK: Identifier: "implementation" [5:2 - 5:16]
+// CHECK: Identifier: "Foo" [5:17 - 5:20]
+// CHECK: Punctuation: "-" [6:1 - 6:2] ObjCInstanceMethodDecl=compare::6:1 (Definition)
+// CHECK: Punctuation: "(" [6:3 - 6:4]
+// CHECK: Keyword: "int" [6:4 - 6:7]
+// CHECK: Punctuation: ")" [6:7 - 6:8]
+// CHECK: Identifier: "compare" [6:8 - 6:15]
+// CHECK: Punctuation: ":" [6:15 - 6:16]
+// CHECK: Punctuation: "(" [6:16 - 6:17]
+// CHECK: Identifier: "Foo" [6:17 - 6:20] ObjCClassRef=Foo:1:12
+// CHECK: Punctuation: "*" [6:20 - 6:21]
+// CHECK: Punctuation: ")" [6:21 - 6:22]
+// CHECK: Identifier: "other" [6:22 - 6:27] ParmDecl=other:6:22 (Definition)
+// CHECK: Punctuation: "{" [6:28 - 6:29]
+// CHECK: Keyword: "return" [7:3 - 7:9]
+// CHECK: Literal: "0" [7:10 - 7:11]
+// CHECK: Punctuation: ";" [7:11 - 7:12]
+// CHECK: Punctuation: "}" [8:1 - 8:2]
+// CHECK: Punctuation: "@" [9:1 - 9:2]
+// CHECK: Identifier: "end" [9:2 - 9:5]
OpenPOWER on IntegriCloud