blob: 830f9828b9243ef7512eba255602eb3804ddf5e2 [file] [log] [blame]
Argyrios Kyrtzidis8a4bfaa2011-08-10 21:12:04 +00001// Test is line- and column-sensitive. Run lines are below.
2
3@interface rdar9771715
4@property (readonly) int foo1;
5@property (readwrite) int foo2;
6@end
7
Argyrios Kyrtzidis3422fbc2011-08-15 18:44:43 +00008@class Foo;
9
10@interface rdar9535717 {
11 __weak Foo *foo;
12}
13@end
14
Argyrios Kyrtzidis75cf3e82011-08-17 19:25:08 +000015@interface Test1 {
16 id _name;
17}
18@end
19@interface Test1 ()
20- (id)name;
21@end
22@interface Test1 ()
23@property (copy) id name;
24@end
25@implementation Test1
26@synthesize name = _name;
27@end
28
Argyrios Kyrtzidis644af7b2012-02-23 21:11:20 +000029@interface rdar10902015
30@end
31
32@implementation rdar10902015
33
Argyrios Kyrtzidis66373dd2012-03-30 00:19:05 +000034struct S { int x; };
Argyrios Kyrtzidis644af7b2012-02-23 21:11:20 +000035
36-(void)mm:(struct S*)s {
37 rdar10902015 *i = 0;
Argyrios Kyrtzidis66373dd2012-03-30 00:19:05 +000038 s->x = 0;
Argyrios Kyrtzidis644af7b2012-02-23 21:11:20 +000039}
40@end
41
Argyrios Kyrtzidis75cf3e82011-08-17 19:25:08 +000042// RUN: c-index-test -cursor-at=%s:4:28 -cursor-at=%s:5:28 %s | FileCheck -check-prefix=CHECK-PROP %s
43// CHECK-PROP: ObjCPropertyDecl=foo1:4:26
44// CHECK-PROP: ObjCPropertyDecl=foo2:5:27
Argyrios Kyrtzidis3422fbc2011-08-15 18:44:43 +000045
Sebastian Pop9ec60df2012-01-20 22:01:23 +000046// RUN: c-index-test -cursor-at=%s:11:11 %s -target x86_64-apple-macosx10.7.0 | FileCheck -check-prefix=CHECK-WITH-WEAK %s
Argyrios Kyrtzidis3422fbc2011-08-15 18:44:43 +000047// CHECK-WITH-WEAK: ObjCClassRef=Foo:8:8
Argyrios Kyrtzidis75cf3e82011-08-17 19:25:08 +000048
49// RUN: c-index-test -cursor-at=%s:20:10 %s | FileCheck -check-prefix=CHECK-METHOD %s
Argyrios Kyrtzidis66373dd2012-03-30 00:19:05 +000050// CHECK-METHOD: 20:7 ObjCInstanceMethodDecl=name:20:7 Extent=[20:1 - 20:12]
Argyrios Kyrtzidis644af7b2012-02-23 21:11:20 +000051
52// RUN: c-index-test -cursor-at=%s:37:17 %s | FileCheck -check-prefix=CHECK-IN-IMPL %s
53// CHECK-IN-IMPL: VarDecl=i:37:17
Argyrios Kyrtzidis66373dd2012-03-30 00:19:05 +000054
55// RUN: c-index-test -cursor-at=%s:38:6 -cursor-at=%s:40:11 %s | FileCheck -check-prefix=CHECK-MEMBERREF %s
56// CHECK-MEMBERREF: 38:6 MemberRefExpr=x:34:16 SingleRefName=[38:6 - 38:7] RefName=[38:6 - 38:7] Extent=[38:3 - 38:7]