blob: ac9e6d351a0a477e83ec21f17455341f7673d2be [file] [log] [blame]
Argyrios Kyrtzidisf39a7ae2012-07-02 23:54:36 +00001
2struct SB {
3 virtual void meth();
4};
5
6struct SS : public SB {
7 void submeth() {
8 this->meth();
9 SB::meth();
10 }
11};
12
13@interface IB
14-(void)meth;
15+(void)ClsMeth;
16@end
17
18@interface IS : IB
19-(void)submeth;
20+(void)ClsMeth;
21@end
22
23@implementation IS
24-(void)submeth {
25 [self meth];
26 [super meth];
27}
28+(void)ClsMeth {
29 [super ClsMeth];
30}
31@end
32
33void foo(SS *ss, IS* is, Class cls) {
34 ss->meth();
35 [is meth];
36 [IB ClsMeth];
37 [cls ClsMeth];
38}
39
40// RUN: c-index-test -cursor-at=%s:8:11 \
41// RUN: -cursor-at=%s:9:11 \
42// RUN: -cursor-at=%s:25:11 \
43// RUN: -cursor-at=%s:26:11 \
44// RUN: -cursor-at=%s:29:11 \
45// RUN: -cursor-at=%s:34:9 \
46// RUN: -cursor-at=%s:35:9 \
47// RUN: -cursor-at=%s:36:9 \
48// RUN: -cursor-at=%s:37:9 \
49// RUN: %s | FileCheck %s
50
51// CHECK: 8:11 MemberRefExpr=meth:3:16 {{.*}} Dynamic-call
52// CHECK-NOT: 9:9 {{.*}} Dynamic-call
Argyrios Kyrtzidise4a990f2012-11-01 02:01:34 +000053// CHECK: 25:3 ObjCMessageExpr=meth:14:8 {{.*}} Dynamic-call Receiver-type=ObjCObjectPointer
Argyrios Kyrtzidisf39a7ae2012-07-02 23:54:36 +000054// CHECK-NOT: 26:3 {{.*}} Dynamic-call
55// CHECK-NOT: 29:3 {{.*}} Dynamic-call
Argyrios Kyrtzidise4a990f2012-11-01 02:01:34 +000056// CHECK: 29:3 {{.*}} Receiver-type=ObjCInterface
Argyrios Kyrtzidisf39a7ae2012-07-02 23:54:36 +000057// CHECK: 34:7 MemberRefExpr=meth:3:16 {{.*}} Dynamic-call
Argyrios Kyrtzidise4a990f2012-11-01 02:01:34 +000058// CHECK: 35:3 ObjCMessageExpr=meth:14:8 {{.*}} Dynamic-call Receiver-type=ObjCObjectPointer
Argyrios Kyrtzidisf39a7ae2012-07-02 23:54:36 +000059// CHECK-NOT: 36:3 {{.*}} Dynamic-call
Argyrios Kyrtzidise4a990f2012-11-01 02:01:34 +000060// CHECK: 36:3 {{.*}} Receiver-type=ObjCInterface
61// CHECK: 37:3 ObjCMessageExpr=ClsMeth:15:8 {{.*}} Dynamic-call Receiver-type=ObjCClass