xref: /minix3/external/bsd/llvm/dist/clang/test/Index/annotate-toplevel-in-objccontainer.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc@interface Foo
2*f4a2713aSLionel Sambucvoid func1(int);
3*f4a2713aSLionel Sambucvoid func2(int);
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc-(void)meth1;
6*f4a2713aSLionel Sambuc-(void)meth2;
7*f4a2713aSLionel Sambuc@end
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambuc@implementation Foo
10*f4a2713aSLionel Sambucvoid func(int);
11*f4a2713aSLionel Sambucstatic int glob1;
12*f4a2713aSLionel Sambucstatic int glob2;
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc-(void)meth1 {}
15*f4a2713aSLionel Sambuc-(void)meth2 {}
16*f4a2713aSLionel Sambuc@end
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc// RUN: c-index-test -write-pch %t.h.pch -x objective-c-header %s.h
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc// RUN: c-index-test -test-annotate-tokens=%s:5:1:7:1 %s -include %t.h \
21*f4a2713aSLionel Sambuc// RUN:     | FileCheck -check-prefix=CHECK-INTER %s
22*f4a2713aSLionel Sambuc// CHECK-INTER: Identifier: "meth1" [5:8 - 5:13] ObjCInstanceMethodDecl=meth1:5:8
23*f4a2713aSLionel Sambuc// CHECK-INTER: Identifier: "meth2" [6:8 - 6:13] ObjCInstanceMethodDecl=meth2:6:8
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc// RUN: c-index-test -test-annotate-tokens=%s:14:1:16:1 %s -include %t.h \
26*f4a2713aSLionel Sambuc// RUN:     | FileCheck -check-prefix=CHECK-IMPL %s
27*f4a2713aSLionel Sambuc// CHECK-IMPL: Identifier: "meth1" [14:8 - 14:13] ObjCInstanceMethodDecl=meth1:14:8 (Definition)
28*f4a2713aSLionel Sambuc// CHECK-IMPL: Identifier: "meth2" [15:8 - 15:13] ObjCInstanceMethodDecl=meth2:15:8 (Definition)
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambuc// RUN: c-index-test -test-annotate-tokens=%s.h:7:1:9:1 %s -include %t.h \
31*f4a2713aSLionel Sambuc// RUN:     | FileCheck -check-prefix=CHECK-PCH %s
32*f4a2713aSLionel Sambuc// CHECK-PCH: Identifier: "meth1" [7:8 - 7:13] ObjCInstanceMethodDecl=meth1:7:8
33*f4a2713aSLionel Sambuc// CHECK-PCH: Identifier: "meth2" [8:8 - 8:13] ObjCInstanceMethodDecl=meth2:8:8
34